General-purpose Text Embedding is a unified multilingual text embedding model developed by the Qwen team. It supports multiple major languages and provides an efficient service for vectorizing text data. This service is suitable for natural language processing (NLP) tasks such as retrieval-augmented generation (RAG), text classification, and sentiment analysis.
Model overview
Singapore
Model | Embedding dimensions | Batch size | Maximum tokens per row (Note) | Price (Mllion input tokens) | Supported languages | Free quota(Note) |
text-embedding-v4 Part of the Qwen3-Embedding series | 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, 64 | 10 | 8,192 | $0.07 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and 100+ other major languages | 1 million tokens Valid for 90 days after you activate Alibaba Cloud Model Studio. |
text-embedding-v3 | 1,024 (default), 768, 512 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and 50+ other major languages | 500,000 tokens Validity: 90 days after you activate Model Studio |
Beijing
Model | Embedding dimensions | Batch size | Maximum tokens per row | Price (Mllion input tokens) | Supported languages |
text-embedding-v4 Part of the Qwen3-Embedding series | 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, 64 | 10 | 8,192 | $0.072 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and 100+ other major languages and multiple programming languages |
For more information about model rate limits, see Rate limits.
Prerequisites
Before making a call, you must get your API key and set it as an environment variable. If you plan to use an SDK, you must also install the appropriate DashScope SDK.
OpenAI compatible
The base_url to configure for SDK calls:
Singapore: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
China (Beijing): https://dashscope.aliyuncs.com/compatible-mode/v1
The endpoint to configure for HTTP calls:
Singapore: POST https://dashscope-intl.aliyuncs.com/compatible-mode/v1/embeddings
China (Beijing): POST https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings
Request body | Input stringPython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings
Input string listPython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings
Input filePython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings Replace 'texts_to_embedding.txt' with your file name or path.
|
model The name of the model to call. Select a model name from the Model overview table. | |
input The input text. The value can be a string, a list of strings, or a file. Each line in the file is treated as a separate text to be embedded. Text limits:
| |
dimensions Specifies the output vector dimensions. This parameter applies only to the text-embedding-v3 and text-embedding-v4 models. You can set this parameter to 2048 (for text-embedding-v4 only), 1536 (for text-embedding-v4 only), 1024, 768, 512, 256, 128, or 64. The default value is 1024. | |
encoding_format Specifies the format of the returned embedding. Currently, only the |
Response object | Successful response
Error response
|
data The output data for the task. | |
model The name of the model that was called. | |
object string The type of the data returned by the call. The default value is list. | |
usage | |
id string The unique request ID. You can use this ID to trace and troubleshoot requests. |
DashScope
The base_url to configure for SDK calls:
Singapore: https://dashscope-intl.aliyuncs.com/api/v1
China (Beijing): https://dashscope.aliyuncs.com/api/v1
The endpoint to configure for HTTP calls:
Singapore: POST https://dashscope-intl.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
China (Beijing): POST https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
Request body | Input stringPython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
Input string listPython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
Input filePython
Java
curlIf you use a model in the China (Beijing) region, use an API key for that region and replace the URL with: https://dashscope.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding Replace 'texts_to_embedding.txt' with your file name or path.
|
model The name of the model to call. Select a model name from the Model overview table. | |
input The input text. The value can be a string, a list of strings, or a file. Each line in the file is treated as a separate text to be embedded. Text limits:
| |
text_type After text is converted to a vector, it can be used for downstream tasks such as retrieval, clustering, and classification. For asymmetric tasks such as retrieval, we recommend distinguishing between query text (query) and document text (document) to achieve better results. For symmetric tasks such as clustering and classification, you can use the default value | |
dimension Specifies the output vector dimensions. This parameter applies only to the text-embedding-v3 and text-embedding-v4 models. You can set this parameter to 2048 (for text-embedding-v4 only), 1536 (for text-embedding-v4 only), 1024, 768, 512, 256, 128, or 64. The default value is 1024. | |
output_type Specifies whether to output a sparse vector representation. This parameter applies only to the text_embedding_v3 and text_embedding_v4 models. Valid values are dense, sparse, and dense&sparse. The default value is dense, which outputs only a dense vector. | |
instruct Adds a custom task description. This parameter takes effect only when you use the |
Response object | Successful response
Error response
|
status_code The status code. A value of 200 indicates a successful request. | |
request_id The unique request ID. You can use this ID to trace and troubleshoot requests. | |
code If the request fails, this parameter indicates the error code. If the request is successful, this parameter is empty. | |
message If the request fails, this parameter indicates the detailed error message. If the request is successful, this parameter is empty. | |
output The output data for the task. | |
usage | |
request_id The unique request ID. You can use this ID to trace and troubleshoot requests. |
Error codes
If a model call fails and an error message is returned, see Error messages for information about how to resolve the issue.