Alibaba Cloud Model Studio's embedding models are compatible with the OpenAI API. To migrate your existing OpenAI applications to Model Studio, you only need to adjust the following three parameters:
- base_url: Replace with
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1. - api_key: Replace with a Model Studio API key.
- model: Replace with a model name from the list below.
Supported models
| Model | Embedding dimensions | Max rows | Maxtokensper line | Price (per 1K input tokens) | Supported languages | Free quota(Note) |
|---|---|---|---|---|---|---|
| qwen3.7-text-embedding | 2,560, 2,048, 1,536, 1,024 (default), 768, 512, 256 | 20 | 128,000 | CNY 0.0005Batch call: CNY 0.00025 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 200 other major languages and dialects | 1 million tokens eachValidity: 90 days after you activate Model Studio |
| qwen3.7-text-embedding-flash | 1,024 (default), 768, 512, 256 | 20 | 128,000 | CNY 0.000125Batch call: CNY 0.000063 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 200 other major languages and dialects | |
text-embedding-v4Part of the Qwen3-Embedding series | 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, 64 | 10 | 8,192 | CNY 0.0005Batch call: CNY 0.00025 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 100 other major languages, plus multiple programming languages | |
| text-embedding-v3 | 1,024 (default), 768, 512, 256, 128, or 64 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 50 other major languages | ||||
| text-embedding-v2 | 1,536 | 25 | 2,048 | CNY 0.0007Batch call: CNY 0.00035 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian | 500,000 tokens eachValidity: 90 days after you activate Model Studio |
| text-embedding-v1 | Chinese, English, Spanish, French, Portuguese, Indonesian |
Multimodal embedding models, such as qwen3-vl-embedding and the tongyi-embedding-vision series, do not support the OpenAI-compatible API. See Multimodal Embedding.
The OpenAI-compatible API does not support sparse vector output. To use
output_type=sparse with text-embedding-v4, call the DashScope API. If output_type=sparse is sent to the OpenAI-compatible API, it returns HTTP 200 with an empty embedding result.How to use
Call examples
This section provides examples of string input using Python (OpenAI SDK) and cURL (HTTP). For examples that use other programming languages or input methods, see Get started with text embedding.
- OpenAI SDK
- HTTP
To call the service using the OpenAI SDK, you must first install the OpenAI SDK.
Result
Result
Sample error response
If an access request error occurs, the cause is indicated by the code and message parameters in the response.