Skip to content

Embeddings

Google multimodal embedding models produce vectors from text, image, audio, video, and PDF inputs. The /v1/embeddings endpoint supports provider file references.

Terminal window
curl https://llmtr.com/v1/embeddings \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-embedding-2-preview",
"input": [
{ "type": "text", "text": "Product label text" },
{
"type": "input_file",
"input_file": {
"file_id": "file_xxx",
"mime_type": "image/jpeg"
}
}
]
}'
TypeDescription
textPlain text
input_fileReference to a Files API upload
image_urlRemote image URL
input_audioInline base64 audio
{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.023, -0.017, ...] },
{ "object": "embedding", "index": 1, "embedding": [0.041, 0.089, ...] }
],
"model": "google/gemini-embedding-2-preview",
"usage": {
"prompt_tokens": 128,
"total_tokens": 128
}
}

Google multimodal embeddings bill by the native unit shown on the model card. Upload large media through the Files API first.

embedding-2-preview supports 768 or 3072. Truncate with dimensions:

{
"model": "google/gemini-embedding-2-preview",
"input": [...],
"dimensions": 768
}