Supported models
| Model | Dimensions | Max tokens | Batch size | Languages | Price (per 1M tokens) | Free quota |
|---|---|---|---|---|---|---|
| text-embedding-v4 | 2048, 1536, 1024 (default), 768, 512, 256, 128, 64 | 8,192 | 10 | 100+ major languages | $0.07 | 1M tokens (90 days) |
| text-embedding-v3 | 1024 (default), 768, 512 | 8,192 | 10 | 50+ languages | $0.07 | 1M tokens (90 days) |
Endpoints
| API key from | Endpoint |
|---|---|
| International | https://dashscope-intl.aliyuncs.com/compatible-mode/v1/embeddings |
| China | https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings |
/embeddings.Authorizations
DashScope API key. Obtain from the Qwen Cloud console.
Body
application/jsonThe model to call. Supported values: text-embedding-v4, text-embedding-v3.
The input text to process. The value can be a string, an array of strings, or a file. When the input is a string, it can contain up to 8,192 tokens. When the input is a list of strings or a file, it can contain up to 10 items (lines), each with a maximum of 8,192 tokens.
The embedding dimensions. Valid values: 2048 (text-embedding-v4 only), 1536 (text-embedding-v4 only), 1024, 768, 512, 256 (text-embedding-v4 only), 128 (text-embedding-v4 only), or 64 (text-embedding-v4 only). Default: 1024.
The format of the returned embedding. Only float is supported.
Response
The output data for the task.
The model that was called.
The type of data returned by the call. Default: list.
Token usage statistics.
The unique request ID. Use this ID to trace and troubleshoot requests.