Embeddings
Google multimodal embedding models produce vectors from text, image, audio, video, and PDF inputs. The /v1/embeddings endpoint supports provider file references.
Example
Section titled “Example”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" } } ] }'Input types
Section titled “Input types”| Type | Description |
|---|---|
text | Plain text |
input_file | Reference to a Files API upload |
image_url | Remote image URL |
input_audio | Inline base64 audio |
Response
Section titled “Response”{ "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 }}Pricing
Section titled “Pricing”Google multimodal embeddings bill by the native unit shown on the model card. Upload large media through the Files API first.
Vector size
Section titled “Vector size”embedding-2-preview supports 768 or 3072. Truncate with dimensions:
{ "model": "google/gemini-embedding-2-preview", "input": [...], "dimensions": 768}