Multimodal Embeddings
POST /v1/multimodalembeddings turns text, images and video into vectors in a
single shared space. Because a text query and a screenshot land in the same
space, you can search slides, product photos, scanned pages or video clips with
plain-language queries, or mix text and images inside one input (for example a
slide's title next to the slide itself).
Multimodal embedding models are served by Voyage AI. List them with
GET /v1/models, where they carry
"kind": "multimodal_embedding", and check the model catalog for
availability and pricing. Text-only embeddings stay on
POST /v1/embeddings.
Quick start
curl -X POST "https://api.llmapi.ai/v1/multimodalembeddings" \
-H "Authorization: Bearer $LLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "voyage-multimodal-3.5",
"input_type": "document",
"inputs": [
{
"content": [
{ "type": "text", "text": "Q3 revenue by region" },
{ "type": "image_url", "image_url": "https://example.com/q3-slide.png" }
]
}
]
}'
{
"object": "list",
"data": [{ "object": "embedding", "embedding": [0.0213, -0.0447, 0.0168], "index": 0 }],
"model": "voyage-multimodal-3.5",
"usage": {
"text_tokens": 8,
"image_pixels": 1000000,
"video_pixels": 0,
"total_tokens": 1793,
"cost_usd_input": 0.00060096,
"cost_usd_output": 0
}
}
Each input returns one vector, in data[] at the input's position. The vector
above is shortened; voyage-multimodal-3.5 returns 1,024 dimensions unless
output_dimension asks for another size. The cost_usd_* fields appear only when your
organization has cost reporting enabled.
Request fields
| Field |
Required |
Description |
model |
Yes |
Multimodal embedding model ID. Prefix it with the provider (voyageai/voyage-multimodal-3.5) to pin one. |
inputs |
Yes |
1 to 1,000 inputs. Each is {"content": [...]}, a list of content pieces embedded together as one vector, in order. |
input_type |
No |
query or document. Prepends a retrieval prompt; use query for search queries and document for what you index. Omit for neither. |
truncation |
No |
true (the default) shortens an input over the token limit; an image cut in the middle is dropped. false rejects it with 400. |
output_dimension |
No |
Vector size: 256, 512, 1024 (the default) or 2048 for voyage-multimodal-3.5. Other models offer their own sizes; Voyage rejects others with 400. |
output_dtype |
No |
Type of each value: float (the default), int8, uint8, binary or ubinary. Smaller types shrink storage at some cost in accuracy. |
output_encoding |
No |
base64 returns each embedding as a Base64-encoded array instead of a JSON array. |
Content pieces
type |
Value field |
Description |
text |
text |
A string. |
image_url |
image_url |
URL of a PNG, JPEG, WEBP or GIF image. |
image_base64 |
image_base64 |
The image as a data URL, such as data:image/png;base64,.... |
video_url |
video_url |
URL of an MP4 video. |
video_base64 |
video_base64 |
The video as a data URL, data:video/mp4;base64,.... |
A piece sets only the value field its type names. One request uses either
URL media or base64 media, not both.
Limits
- Up to 1,000 inputs per request.
- Images: up to 16 million pixels and 20 MB each. Videos: MP4, up to 20 MB each.
- Up to 32,000 tokens per input and 320,000 per request, where 560 image pixels or 1,120 video pixels count as one token.
- A request Voyage rejects for a limit or an unreadable file fails with
400 and Voyage's own message.
Billing
A request is charged on the usage Voyage reports: text_tokens at the model's
text price plus image_pixels and video_pixels at its pixel price, using the
rates GET /v1/models lists for the model:
cost = text_tokens × pricing.prompt
+ (image_pixels + video_pixels) / 1,000,000 × pricing.price_per_1m_pixels
pricing.prompt is the text price per token and pricing.price_per_1m_pixels
the price per million pixels. The model catalog shows the same
rates. Voyage counts each image as at least 50,000 and at most 2,000,000
pixels, and each video frame as an image. Credits are reserved from an upper-bound estimate before the call and
settled on the reported usage. Requests served with your organization's own
Voyage key are not charged to your credits; when cost reporting is enabled,
their response still reports cost_usd_* at the model's price.
Python example
import os
import requests
response = requests.post(
"https://api.llmapi.ai/v1/multimodalembeddings",
headers={"Authorization": f"Bearer {os.environ['LLM_API_KEY']}"},
json={
"model": "voyage-multimodal-3.5",
"input_type": "query",
"inputs": [{"content": [{"type": "text", "text": "chart of Q3 revenue by region"}]}],
},
timeout=60,
)
response.raise_for_status()
vector = response.json()["data"][0]["embedding"]
print(len(vector))
Notes
- Responses arrive in one piece. There is no streaming, no batch submission, and no provider fallback.
- The gateway checks
model, inputs, input_type, output_dtype, output_encoding, that output_dimension is positive, and every content piece before forwarding, so a malformed request returns 400 naming the field.
- Per-minute token limits count each request's upper bound before it runs (an image as 3,572 tokens, a video as a full 32,000-token input) and settle on the
total_tokens Voyage reports.
- A request can also fail for an unknown model, insufficient credits, a rate limit, or a provider error; provider rejections keep the provider's message.
API operation: POST /v1/multimodalembeddings