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}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1.For other regions, replace the base_url:
- api_key: Replace with a Model Studio API key.
- model: Replace with a model name from the list below.
Supported models
- Singapore
- China (Beijing)
- China (Hong Kong)
Model | Embedding dimensions | Max rows | Max tokens per line (Note) | Price (per 1M input tokens) | Supported languages | Free quota (Note) |
|---|---|---|---|---|---|---|
text-embedding-v4 Qwen3-Embedding series | 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, or 64 | 10 | 8,192 | $0.07 | More than 100 mainstream languages, such as Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian | 1 million tokens Valid for 90 days after Model Studio activation |
text-embedding-v3 | 1,024 (default), 768, or 512 | More than 50 mainstream languages, such as Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian | 500,000 tokens Valid for 90 days after Model Studio activation |
Multimodal embedding models, such as qwen3-vl-embedding and the tongyi-embedding-vision series, do not support the OpenAI-compatible API. See Multimodal Embedding.
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
Result
Result
Sample error response
If an access request error occurs, the cause is indicated by the code and message parameters in the response.