# Embed an image

> Run a vision encoder on one image, or a video encoder on a short clip, and get its embedding.

`POST https://api.openrobotics.dev/v1/embed`

Embeddings come back L2-normalised at the model's real width. Depth-image encoders (`eth/defm`) take a depth map as `image`: a 16-bit grayscale PNG of depth in millimetres, 0 for no measurement.

## Authorization

`Authorization: Bearer sk-orb-v1-…`, your [API key](https://www.openrobotics.dev/docs/authentication), or a free [test key](https://www.openrobotics.dev/docs/authentication#test-keys) (`sk-orb-test-…`; no account? get one with [`POST /sandbox/keys`](https://www.openrobotics.dev/docs/api/create-sandbox-key)).

## Request body

JSON, with `Content-Type: application/json`.

- `model` (string, required): The encoder to run, e.g. `google/siglip2-so400m`. The live models for this endpoint are listed below.
- `image` (string): The image, base64 JPEG or PNG. Under 4 MB of base64. Send `image` or `frames`.
- `frames` (string[]): Video encoders only (e.g. `meta/v-jepa-2-encoder`): a clip of 1–64 frames, oldest first, all the same size, under 4 MB of base64 together. Billed per 16 frames, so 64 frames cost 4 calls.

## Response

- `id` (string): Unique id of this call, e.g. `emb_48213`. It matches the call in your Activity dashboard.
- `model` (string): The model that answered.
- `backend` (string): `"http"`: the real model ran on a GPU. `"simulated"`: stand-in output of the same shape, as test keys get.
- `sandbox` (boolean): `true` when the call was made with a [test key](https://www.openrobotics.dev/docs/authentication#test-keys): the output is simulated, nothing ran on a GPU and nothing was charged. Absent otherwise.
- `embedding` (number[]): The embedding, unit length. For a clip, one vector for the whole clip.
- `dim` (integer): Its length, e.g. `1152` for SigLIP 2 So400m.
- `usage` (object): What the call cost.
  - `cost_usd` (number): Charged to your credits, in US dollars.
  - `latency_ms` (integer): Time the model took, in milliseconds.

## Errors

- `400`: `frames` sent to an encoder that embeds single images

Plus the errors every endpoint shares: see [Errors](https://www.openrobotics.dev/docs/errors).

## Example request

Python:

```python
import os, requests

res = requests.post(
  "https://api.openrobotics.dev/v1/embed",
  headers={"Authorization": f"Bearer {os.environ['OPENROBOTICS_API_KEY']}"},
  json={
    "model": "google/siglip2-so400m",
    "image": "<base64 JPEG or PNG>",
  },
).json()
res["embedding"]        # unit-length vector
```

TypeScript:

```typescript
const res = await fetch("https://api.openrobotics.dev/v1/embed", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.OPENROBOTICS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "google/siglip2-so400m",
    image: "<base64 JPEG or PNG>",
  }),
}).then((r) => r.json());
```

cURL:

```bash
curl https://api.openrobotics.dev/v1/embed \
  -H "Authorization: Bearer $OPENROBOTICS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"google/siglip2-so400m","image":"<base64 JPEG or PNG>"}'
```

## Example response

```json
{
  "id": "emb_48213",
  "model": "google/siglip2-so400m",
  "backend": "http",
  "embedding": [0.0213, -0.0087, …],
  "dim": 1152,
  "usage": { "cost_usd": 0.00002, "latency_ms": 38 }
}
```

## Models

40 live for `/embed`:

- [SigLIP So400m](https://www.openrobotics.dev/models/google/siglip-so400m.md): `google/siglip-so400m`, $0.02 per 1,000 calls
- [DINOv2](https://www.openrobotics.dev/models/meta/dinov2.md): `meta/dinov2`, $0.02 per 1,000 calls
- [ResNet-18 / ResNet-50](https://www.openrobotics.dev/models/microsoft/resnet-18.md): `microsoft/resnet-18`, $0.02 per 1,000 calls
- [CLIP ViT-L/14](https://www.openrobotics.dev/models/openai/clip-vit-l-14.md): `openai/clip-vit-l-14`, $0.02 per 1,000 calls
- [SigLIP 2](https://www.openrobotics.dev/models/google/siglip2-so400m.md): `google/siglip2-so400m`, $0.02 per 1,000 calls
- [EfficientNet](https://www.openrobotics.dev/models/google/efficientnet.md): `google/efficientnet`, $0.02 per 1,000 calls
- [R3M](https://www.openrobotics.dev/models/meta/r3m.md): `meta/r3m`, $0.02 per 1,000 calls
- [DINOv3](https://www.openrobotics.dev/models/meta/dinov3.md): `meta/dinov3`, $0.02 per 1,000 calls
- [MAE (Masked Autoencoder)](https://www.openrobotics.dev/models/meta/mae.md): `meta/mae`, $0.02 per 1,000 calls
- [Vision Transformer (ViT)](https://www.openrobotics.dev/models/google/vit.md): `google/vit`, $0.02 per 1,000 calls
- [OpenCLIP (ViT-H/14, ViT-bigG/14)](https://www.openrobotics.dev/models/laion/openclip.md): `laion/openclip`, $0.05 per 1,000 calls
- [EVA-CLIP / EVA02-CLIP](https://www.openrobotics.dev/models/baai/eva-clip.md): `baai/eva-clip`, $0.02 per 1,000 calls
- [V-JEPA 2 encoder](https://www.openrobotics.dev/models/meta/v-jepa-2-encoder.md): `meta/v-jepa-2-encoder`, $0.02 per 1,000 calls
- [C-RADIOv4](https://www.openrobotics.dev/models/nvidia/c-radiov4.md): `nvidia/c-radiov4`, $0.02 per 1,000 calls
- [Perception Encoder (PE-Core / PE-Lang / PE-Spatial)](https://www.openrobotics.dev/models/meta/perception-encoder.md): `meta/perception-encoder`, $0.10 per 1,000 calls
- [Voltron](https://www.openrobotics.dev/models/stanford/voltron.md): `stanford/voltron`, $0.10 per 1,000 calls
- [LIV](https://www.openrobotics.dev/models/upenn/liv.md): `upenn/liv`, $0.10 per 1,000 calls
- [SPA](https://www.openrobotics.dev/models/haoyizhu/spa.md): `haoyizhu/spa`, $0.10 per 1,000 calls
- [HRP](https://www.openrobotics.dev/models/cmu/hrp.md): `cmu/hrp`, $0.10 per 1,000 calls
- [SAM image encoder](https://www.openrobotics.dev/models/meta/sam-encoder.md): `meta/sam-encoder`, $0.02 per 1,000 calls
- [SAM 2 image encoder (Hiera)](https://www.openrobotics.dev/models/meta/sam-2-encoder.md): `meta/sam-2-encoder`, $0.02 per 1,000 calls
- [InternViT (6B / 300M)](https://www.openrobotics.dev/models/opengvlab/internvit.md): `opengvlab/internvit`, $0.02 per 1,000 calls
- [V-JEPA 2.1 encoder](https://www.openrobotics.dev/models/meta/v-jepa-2.1-encoder.md): `meta/v-jepa-2.1-encoder`, $0.02 per 1,000 calls
- [InternVideo2](https://www.openrobotics.dev/models/opengvlab/internvideo2.md): `opengvlab/internvideo2`, $0.10 per 1,000 calls
- [TULIP](https://www.openrobotics.dev/models/berkeley/tulip.md): `berkeley/tulip`, $0.05 per 1,000 calls
- [RICE (MLCD successor)](https://www.openrobotics.dev/models/deepglint/rice.md): `deepglint/rice`, $0.02 per 1,000 calls
- [DeFM (Depth Foundation Model)](https://www.openrobotics.dev/models/eth/defm.md): `eth/defm`, $0.02 per 1,000 calls
- [FiT3D](https://www.openrobotics.dev/models/eth/fit3d.md): `eth/fit3d`, $0.02 per 1,000 calls
- [TIPSv2](https://www.openrobotics.dev/models/google/tipsv2.md): `google/tipsv2`, $0.02 per 1,000 calls
- [VideoPrism](https://www.openrobotics.dev/models/google/videoprism.md): `google/videoprism`, $0.02 per 1,000 calls
- [DynaFLIP](https://www.openrobotics.dev/models/larr/dynaflip.md): `larr/dynaflip`, $0.02 per 1,000 calls
- [Perception Encoder Audio-Visual (PE-AV)](https://www.openrobotics.dev/models/meta/pe-av.md): `meta/pe-av`, $0.05 per 1,000 calls
- [UniViTAR](https://www.openrobotics.dev/models/mm-mvr/univitar.md): `mm-mvr/univitar`, $0.02 per 1,000 calls
- [MoonViT](https://www.openrobotics.dev/models/moonshotai/moonvit.md): `moonshotai/moonvit`, $0.02 per 1,000 calls
- [Cosmos-Embed1](https://www.openrobotics.dev/models/nvidia/cosmos-embed1.md): `nvidia/cosmos-embed1`, $0.02 per 1,000 calls
- [InternVideo-Next](https://www.openrobotics.dev/models/opengvlab/internvideo-next.md): `opengvlab/internvideo-next`, $0.02 per 1,000 calls
- [FG-CLIP 2](https://www.openrobotics.dev/models/qihoo360/fg-clip-2.md): `qihoo360/fg-clip-2`, $0.05 per 1,000 calls
- [LingBot-Vision](https://www.openrobotics.dev/models/robbyant/lingbot-vision.md): `robbyant/lingbot-vision`, $0.02 per 1,000 calls
- [Long-CLIP](https://www.openrobotics.dev/models/thu/longclip.md): `thu/longclip`, $0.02 per 1,000 calls
- [OpenVision](https://www.openrobotics.dev/models/ucsc-vlaa/openvision.md): `ucsc-vlaa/openvision`, $0.02 per 1,000 calls
