Embeddings
OpenAI-compatible
Embeddings
POST /v1/embeddings — text embedding vectors
POST
Embeddings
Convert text into high-dimensional vectors for semantic retrieval, clustering, recommendation and more.
Truncated vectors preserve semantics while using less memory / compute.
Request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | Embedding model ID |
input | string | array | ✅ | A single string or an array |
encoding_format | string | float (default) or base64 | |
dimensions | integer | Truncate to a specified dimension (text-embedding-3-* only) | |
user | string | End-user identifier |
Recommended models
| Model ID | Dimensions | Notes |
|---|---|---|
text-embedding-3-small | 1536 (reducible ≥ 512) | Default recommendation |
text-embedding-3-large | 3072 (reducible ≥ 256) | High quality |
text-embedding-ada-002 | 1536 | Older |
text-embedding-004 | 768 | |
bge-m3 | 1024 | Multilingual open-source |
text-embedding-v3 | 1024 | Tongyi Qianwen |
Response
Python example
Dimension truncation
Billing
Charged byprompt_tokens only — no output tokens. See Billing.