← Docs
Embeddings
Turn text or supported vision inputs into vectors for RAG, semantic search, clustering, and recommendations. Start text workloads with text-embedding-v4; use /v1/models and the model detail page for vision embedding models.
Supported models
| Model | Dim | Ctx | Price / 1M | Best for |
|---|---|---|---|---|
| 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 |
| qwen3-vl-embedding | Model-specific | Model-specific | See model details | Multimodal embedding tasks |
Example
Python
import osfrom openai import OpenAIclient = OpenAI(base_url="https://test.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]
Parameters
| Field | Type | Description |
|---|---|---|
| model | string | text-embedding-v4, tongyi-embedding-vision-plus, tongyi-embedding-vision-flash, qwen3-vl-embedding |
| input | string | string[] | Text to embed; arrays must not be empty |
| encoding_format | string | float, base64 |
| dimensions | integer | Optional output dimension override when supported; must be greater than 0 |
Which one?
- text-embedding-v4: General-purpose text embedding model for RAG, semantic search, and recommendation baselines. It returns 1024-dimensional vectors.
- tongyi-embedding-vision-plus / flash: Use for image, image-text retrieval, and visual similarity tasks. Choose input fields from the model detail page.
- qwen3-vl-embedding: Use for multimodal embedding probes; first probes should use one short input.
Performance tips
- Prefer batch input (array form) to reduce request overhead and improve throughput.
- If you use cosine similarity, L2-normalize before storing so retrieval can use dot product.
- Chunk size: 500-800 tokens with 50-100 token overlap is a safe default.
- Before launch, evaluate retrieval quality, reranking, and cost with a representative query set.