Turn text or supported multimodal inputs into vectors for RAG, semantic search, clustering, and recommendations. Start text workloads with text-embedding-v4; evaluate gemini-embedding-2 when one index must compare supported Google text, image, video, audio, or PDF inputs, and confirm current input types on the model detail page before production use.
| Model | Dim | Ctx | Price / 1M | Best for |
|---|---|---|---|---|
| gemini-embedding-2 | 3072 | 8K | See model details | Supported Google text and multimodal embedding inputs |
| gemini-embedding-001 | 3072 | 2K | See model details | Text embeddings with task_type support |
| text-embedding-v4 | 1024 | 8K | $0.13 | General, English-leaning |
| tongyi-embedding-vision-plus | Model-specific | Model-specific | See model details | Vision embedding and image-text retrieval |
| tongyi-embedding-vision-flash | Model-specific | Model-specific | See model details | Lower-latency vision embedding |
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)# Single stringres = client.embeddings.create(model="text-embedding-v4",input="SeaLink helps SEA developers ship AI faster.")vec = res.data[0].embedding # 1024-dimensional vector# Batch (recommended for performance)texts = ["Doc 1 content", "Doc 2 content", "Doc 3 content"]res = client.embeddings.create(model="text-embedding-v4", input=texts)vectors = [d.embedding for d in res.data]
| Field | Type | Description |
|---|---|---|
| model | string | text-embedding-v4, gemini-embedding-2, gemini-embedding-001, tongyi-embedding-vision-plus, tongyi-embedding-vision-flash |
| input | string | string[] | object | Text to embed; gemini-embedding-2 also accepts supported objects with image, video, audio, pdf, file_uri, mime_type, and optional text. |
| encoding_format | string | float, base64 |
| dimensions | integer | Optional output dimension override when supported. Gemini embedding models support 128-3072. |
| output_dimensionality | integer | Alias for dimensions. gemini-embedding-001 and gemini-embedding-2 default to 3072; 768, 1536, and 3072 are recommended. |
| document_ocr | boolean | Optional PDF OCR control for gemini-embedding-2. |
| audio_track_extraction | boolean | Optional video audio-track extraction control for gemini-embedding-2. |
| task_type | string | Use only on models that support task_type, such as gemini-embedding-001. Do not send it to gemini-embedding-2; put the task instruction in input text. |