The general-purpose text embedding model converts text data into numerical vectors for downstream tasks like semantic search, recommendation, clustering, and classification.
Model overview
Singapore
| Model | Embedding dimensions | Max rows | Max tokens per line(Note) | Price (per 1M 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 | $0.07 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 200 other major languages and dialects | 1 million tokens Validity: 90 days after you activate Model Studio |
text-embedding-v4
| 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 over 100 other major languages | 1 million tokens Validity: 90 days after you activate Model Studio |
text-embedding-v3 | 1,024 (default), 768, 512 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, Russian, and over 50 other major languages | 500,000 tokens Validity: 90 days after you activate Model Studio |
China (Beijing)
| Model | Embedding dimensions | Max rows | Max tokens per line | Price (per 1M input tokens) | Supported languages |
|---|---|---|---|---|---|
text-embedding-v4
| 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 over 100 other major languages, plus multiple programming languages |
China (Hong Kong)
| Model | Embedding dimensions | Max rows | Max tokens per line | Price (per 1M input tokens) | Supported languages |
|---|---|---|---|---|---|
text-embedding-v4
| 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 over 100 other major languages, plus multiple programming languages |
For model rate limits, see Rate limiting.
Prerequisites
Users familiar with the OpenAI ecosystem can use the OpenAI-compatible API for a quick migration. The DashScope API provides more unique features.
Obtain an API key and export the API key as an environment variable. If you use an SDK to make calls, install the DashScope SDK.
OpenAI compatibility
Thebase_urlto configure for SDK calls:
- Singapore: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1. Replace
WorkspaceIdwith your actual workspace ID. - China (Beijing): https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
- China (Hong Kong): https://{WorkspaceId}.cn-hongkong.maas.aliyuncs.com/compatible-mode/v1. Replace
WorkspaceIdwith your actual workspace ID.
Theendpointto configure for HTTP calls:
- Singapore: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/embeddings. Replace
WorkspaceIdwith your actual workspace ID. - China (Beijing): POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/embeddings
- China (Hong Kong): POST https://{WorkspaceId}.cn-hongkong.maas.aliyuncs.com/compatible-mode/v1/embeddings. Replace
WorkspaceIdwith your actual workspace ID.
Replace {WorkspaceId} with your actual workspace ID.
Request bodymodel The name of the model to call. See the Model overview table for model names. input The input text to process. The input can be a string, an array of strings, or a file. Limits on text length and batch size vary by model version:
dimensions The dimension of the output embedding vectors. Must be one of the following values: encoding_format The returned embedding format. Currently, only | Input stringPythonJavacurl
dashscope CLICall via the dashscope command line. ImportantThe SDK Expert interactive assistant can accomplish the same development and troubleshooting via natural language, see DashScope SDK Expert.For the complete region table, see Base URL overview. Input string listPythonJavacurl
Input filePythonJavacurl
|
Response objectdata A list of the resulting embedding objects. model The name of the model used for this call. objectstring The object type. The value is always usage idstring A unique request identifier, used for tracing and troubleshooting. | |
DashScope
base_urlfor SDK calls:
- Singapore: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1. Replace
WorkspaceIdwith your actual workspace ID. - China (Beijing): https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1
- China (Hong Kong): https://{WorkspaceId}.cn-hongkong.maas.aliyuncs.com/api/v1. Replace
WorkspaceIdwith your actual workspace ID.
- Singapore: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding. Replace
WorkspaceIdwith your actual workspace ID. - China (Beijing): POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding
- China (Hong Kong): POST https://{WorkspaceId}.cn-hongkong.maas.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding. Replace
WorkspaceIdwith your actual workspace ID.
Replace {WorkspaceId} with your actual workspace ID.
Request bodymodel The model to use. For a list of available models, see the Model overview table. input The text to process. The input can be a string, an array of strings, or a file. The supported text length and batch size vary by model version.
text_type
Text converted to embeddings can be applied to downstream tasks such as retrieval, clustering, and classification. For asymmetric tasks such as retrieval, it is recommended to differentiate between query text (query) and document text (document) to achieve better retrieval performance. For symmetric tasks such as indexing, clustering, and classification, you can simply use the system default value of dimension
Specifies the embedding dimension for the output vector. Valid values are output_type
Specifies the output vector type. This parameter applies only to the instruct Provides custom instructions to guide the model in understanding the query intent. English instructions are recommended, as they typically improve performance by 1% to 5%. | Input stringPythonJavacurl
Input string listPythonJavacurl
Input filePythonJavacurl
|
Response objectstatus_code The HTTP status code. A value of 200 indicates success. request_id A unique identifier for the request. Use this ID to trace and troubleshoot the request. code The error code returned if the request fails. This field is empty for successful requests. message A detailed error message if the request fails. This field is empty for successful requests. output The result of the task. usage | |
Error codes
If a model call fails, see Error Messages.