Embedding models convert data such as text, images, and videos into vectors for downstream tasks, including semantic search, recommendation, clustering, classification, and anomaly detection.
Prerequisites
Obtain an API key and export the API key as an environment variable. If you use the OpenAI SDK or DashScope SDK to make calls, install the SDK.
Get embeddings
- Text embedding
- Independent multimodal vectors
- Multimodal fused vectors
- OpenAI compatible API
- DashScope
Model selection
Choose the right model based on your input data type and use case.
-
Processing plain text or code: Use
qwen3.7-text-embedding. It is the highest-performing model, supporting advanced features such as task instruction and a sparse vector to cover most text processing use cases. For cost- and throughput-sensitive scenarios, use the lightweight versionqwen3.7-text-embedding-flash. It also supports task instruction and the three vector output types, maintains 201-language support and 128K context, and lets you choose vector dimensions from 256 to 1024 at a more cost-effective price. -
Processing multimodal content:
- Fused embedding: To represent single-modal or mixed-modal inputs as a fused embedding for use cases such as cross-modal retrieval and image search, use
qwen2.5-vl-embedding,qwen3-vl-embedding,tongyi-embedding-vision-plus-2026-03-06, ortongyi-embedding-vision-flash-2026-03-06. For example, you can input an image of a shirt with the text "find a similar style that looks more youthful," and the model fuses the image and task instruction into a single embedding for processing. - Independent embedding: To generate an independent embedding for each input part (such as an image and its corresponding text caption), use
tongyi-embedding-vision-plus,tongyi-embedding-vision-flash,tongyi-embedding-vision-plus-2026-03-06,tongyi-embedding-vision-flash-2026-03-06, or the general-purpose multimodal modelmultimodal-embedding-v1.
- Fused embedding: To represent single-modal or mixed-modal inputs as a fused embedding for use cases such as cross-modal retrieval and image search, use
-
Processing large-scale data: To process large-scale, non-real-time text data, use
qwen3.7-text-embedding,qwen3.7-text-embedding-flash, ortext-embedding-v4with the OpenAI compatible batch API to significantly reduce costs.
Text embedding
- Beijing
- Singapore
| Model | Embedding dimensions | Batch size | Max tokens per batch (note) | Price (per 1,000 input tokens) | Free quota(note) | Languages |
|---|---|---|---|---|---|---|
| qwen3.7-text-embedding | 2,560, 2,048, 1,536, 1,024 (default), 768, 512, or 256 | 20 | 128,000 | CNY 0.0005batch API call: CNY 0.00025 | 1 million tokensValid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later | 201 major languages and dialects, including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian
All supported languages Sino-Tibetan: Chinese (Simplified Chinese, Traditional Chinese, Cantonese), Burmese, Tibetan, MeiteiIndo-European: English, French, Portuguese, German, Romanian, Swedish, Danish, Bulgarian, Russian, Czech, Greek, Ukrainian, Spanish, Dutch, Slovak, Croatian, Polish, Lithuanian, Norwegian (Bokmål), Norwegian Nynorsk, Persian, Slovenian, Gujarati, Latvian, Italian, Occitan, Nepali, Marathi, Belarusian, Serbian, Luxembourgish, Venetian, Assamese, Welsh, Silesian, Asturian, Chhattisgarhi, Awadhi, Maithili, Bhojpuri, Sindhi, Irish, Faroese, Hindi, Punjabi, Bengali, Odia, Tajik, Eastern Yiddish, Lombard, Ligurian, Sicilian, Friulian, Sardinian, Galician, Catalan, Icelandic, Tosk, Albanian, Limburgish, Dari, Afrikaans, Macedonian, Sinhala, Urdu, Magahi, Bosnian, Armenian, Latgalian, Scottish Gaelic, Central Kurdish, Northern Kurdish, Southern Pashto, Sanskrit, Dhundari, Marwari, Ahirani, Bagheli, Bagri, Bundeli, Braj, Kumaoni, KashmiriAfro-Asiatic: Arabic (Standard, Najdi, Levantine, Egyptian, Moroccan, Mesopotamian, Ta’izzi-Adeni, Tunisian, Gulf, Algerian, Sudanese, Libyan), Hebrew, Maltese, Amharic, Tigrinya, Kabyle, Somali, West Central Oromo, HausaAustronesian: Indonesian, Malay, Tagalog, Cebuano, Javanese, Sundanese, Minangkabau, Balinese, Banjar, Pangasinan, Iloko, Waray (Philippines), Plateau Malagasy, Malagasy, Buginese, Maori, Samoan, Hawaiian, FijianDravidian: Tamil, Telugu, Kannada, MalayalamTurkic: Turkish, North Azerbaijani, Northern Uzbek, Kazakh, Bashkir, Tatar, Crimean Tatar, Kyrgyz, Turkmen, UyghurTai-Kadai: Thai, Lao, ShanUralic: Finnish, Estonian, Hungarian, Meadow MariAustroasiatic: Vietnamese, KhmerNiger-Congo: Yoruba, Ewe, Kinyarwanda, Lingala, Northern Sotho, Nyanja, Shona, Southern Sotho, Tswana, Xhosa, Zulu, Luganda, Swati, Tsonga, Tumbuka, Venda, Chokwe, Luba-Kasai, Rundi, Umbundu, Kikuyu, Kongo, Nigerian Fulfulde, Wolof, Fon, Kabiyè, Mossi, Akan, Twi, Bambara, IgboOther: Japanese, Korean, Georgian, Basque, Haitian Creole, Papiamento, Kabuverdianu, Tok Pisin, Swahili, Central Aymara, Tulu, Naga, Nigerian Pidgin, Mauritian Creole, Sango, Ayacucho Quechua, Khalkha Mongolian, Southwestern Dinka, Nuer, Guarani |
qwen3.7-text-embedding-flashLightweight version of qwen3.7-text-embedding, more cost-effective | 1,024 (default), 768, 512, or 256 | 20 | 128,000 | CNY 0.000125batch API call: CNY 0.000063 | 1 million tokensValid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later | 201 major languages and dialects, including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian |
text-embedding-v4Part of the Qwen3-Embedding series | 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, or 64 | 10 | 33,000 | CNY 0.0005batch API call: CNY 0.00025 | 1 million tokensValid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later | 100+ languages, including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian |
| text-embedding-v3 | 1,024 (default), 768, 512, 256, 128, or 64 | 8,192 | CNY 0.0005batch API call: CNY 0.00025 | 500,000 tokens eachValid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later | 50+ languages, including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian | |
| text-embedding-v2 | 1,536 | 25 | 2,048 | CNY 0.0007batch API call: CNY 0.00035 | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian | |
| text-embedding-v1 | Chinese, English, Spanish, French, Portuguese, and Indonesian | |||||
| text-embedding-async-v2 | 100,000 | CNY 0.0007 | 20 million tokensValid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later | Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian | ||
| text-embedding-async-v1 | Chinese, English, Spanish, French, Portuguese, and Indonesian |
- string array input: The array can contain up to 10 elements.
- file input: The text file can contain up to 10 lines.
Multimodal embedding
This model generates embeddings from text, image, or video inputs. You can use these embeddings for tasks like video and image classification, image-text retrieval, and text-to-image or text-to-video search.
The API accepts single text, image, or video inputs, as well as combinations like text and images. Some models support multiple inputs of the same type, such as multiple images. For details, see the limitations for each model.
- China (Beijing)
- Singapore
Model | Embedding dimensions | Text length limit | Image size limit | Video size limit | Price (per 1,000 tokens) | Free quota(Note) |
|---|---|---|---|---|---|---|
qwen3-vl-embedding | 2560 (default), 2048, 1536, 1024, 768, 512, 256 | 32,000 token | Up to 10 MB per image | Up to 50 MB per video file | Image/Video: CNY 0.0018 Text: CNY 0.0007 | 1 million token This free quota is valid for 90 days from the date of Model Studio activation, model release, or application approval, whichever is later. |
qwen2.5-vl-embedding | 2048, 1024 (default), 768, 512 | Up to 5 MB per image | ||||
tongyi-embedding-vision-plus-2026-03-06 | 1152 (default), 1024, 512, 256, 128, 64 | 1,024 token | Recommended: up to 5 MB per image; maximum: 10 MB. Supports up to 64 images. | Up to 50 MB per video file Video encoding must be H.264 or H.265. | CNY 0.0005 | |
tongyi-embedding-vision-flash-2026-03-06 | 768 (default), 512, 256, 128, 64 | CNY 0.00015 | ||||
tongyi-embedding-vision-plus | 1152 | Up to 3 MB per image. Supports up to 8 images. | Up to 10 MB per video file | CNY 0.0005 | ||
tongyi-embedding-vision-flash | 768 | CNY 0.00015 | ||||
multimodal-embedding-v1 | 1,024 | 512 token | Up to 3 MB per image | Up to 10 MB per video file | Image/Video: CNY 0.0009 Text: CNY 0.0007 |
Input and language restrictions
| Fused multimodal models | ||||
|---|---|---|---|---|
| Model | Text | Image | Video | Request limit |
| qwen3-vl-embedding | Supports 33 major languages, such as Chinese, English, Japanese, Korean, French, and German.
All supported languages Chinese, Japanese, Korean, Indonesian, Vietnamese, Thai, English, French, German, Russian, Portuguese, Spanish, Italian, Swedish, Danish, Czech, Norwegian, Dutch, Finnish, Turkish, Polish, Swahili, Romanian, Serbian, Greek, Kazakh, Uzbek, Cebuano, Arabic, Urdu, Persian, Hindi / Devanagari, and Hebrew. | JPEG, PNG, WEBP, BMP, TIFF, ICO, DIB, ICNS, and SGI (URL or Base64 supported) | MP4, AVI, and MOV (URL only) | A single request can contain up to 20 content elements. This includes a maximum of 10 images and 1 video. |
| qwen2.5-vl-embedding | Supports 11 major languages, such as Chinese, English, Japanese, Korean, French, and German.
All supported languages Chinese, English, Japanese, Korean, French, German, Russian, Portuguese, Spanish, Italian, and Indonesian. | A single request can contain a maximum of one of each content type: image, text, video, and fused object. | ||
| Multimodal embedding models | ||||
| Model | Text | Image | Video | Request limit |
| tongyi-embedding-vision-plus-2026-03-06 | Supports over 30 major languages, such as Chinese, English, Japanese, and Korean.
All supported languages Chinese, Japanese, Korean, Indonesian, Vietnamese, Thai, English, French, German, Russian, Portuguese, Spanish, Italian, Swedish, Danish, Czech, Norwegian, Dutch, Finnish, Turkish, Polish, Swahili, Romanian, Serbian, Greek, Kazakh, Uzbek, Cebuano, Arabic, Urdu, Persian, Hindi / Devanagari, and Hebrew. | JPEG, PNG, WEBP, BMP, TIFF, ICO, DIB, ICNS, and SGI (URL or Base64 supported) | MP4, MPEG, MOV, MPG, WEBM, AVI, FLV, and MKV (URL only) | A single request can contain up to 20 text elements, 64 images, and 8 videos. |
| tongyi-embedding-vision-flash-2026-03-06 | ||||
| tongyi-embedding-vision-plus | Chinese and English | JPG, PNG, and BMP (URL or Base64 supported) | MP4, MPEG, MOV, MPG, WEBM, AVI, FLV, and MKV (URL only) | No limit on the number of content elements. The total number of input tokens must not exceed the batch processing limit. |
| tongyi-embedding-vision-flash | ||||
| multimodal-embedding-v1 | Chinese and English | JPG, PNG, and BMP (URL or Base64 supported) | A single request is limited to 20 content elements. This limit is shared among a maximum of 1 image, 1 video, and 20 text elements. | |
Core features
Customize vector dimensions
The qwen3.7-text-embedding, qwen3.7-text-embedding-flash, text-embedding-v4, text-embedding-v3, tongyi-embedding-vision-plus-2026-03-06, tongyi-embedding-vision-flash-2026-03-06, qwen3-vl-embedding, and qwen2.5-vl-embedding models support custom vector dimensions. Higher dimensions preserve more semantic information but increase storage and compute costs.
- General use cases (Recommended): A dimension of 1024 provides an optimal balance between performance and cost, making it ideal for most semantic search tasks.
- High-precision scenarios: For applications that require high precision, you can select a dimension of 1536 or 2048. This improves precision but significantly increases storage and compute overhead.
- Resource-constrained environments: In cost-sensitive scenarios, select a dimension of 768 or lower. This significantly reduces resource consumption at the cost of some semantic information.
Query vs. document text (text_type)
This parameter is only available through the DashScope SDK and API.To achieve optimal results in search tasks, you should vectorize content differently based on its role. The
text_type parameter is designed for this purpose:
text_type: 'query': Use for user-provided query text. The model generates a "title-like" vector that is more directional and optimized for information retrieval.text_type: 'document'(default): Use for the document text stored in your knowledge base. The model generates a "body-like" vector that contains more comprehensive information and is optimized for matching.
query and document. However, for tasks such as clustering or classification where all texts have the same role, you do not need to set this parameter.
Task instructions (instruct)
This parameter is only available through the DashScope SDK and API.You can provide a clear English task instruction to guide the
qwen3.7-text-embedding, qwen3.7-text-embedding-flash, and text-embedding-v4 models in optimizing vector quality for specific retrieval scenarios, improving precision. qwen3.7-text-embedding improves instruction-following capability by 16.4% over text-embedding-v4, so we recommend that you use it first. When using this feature, you must set the text_type parameter to query.
Dense and sparse vectors
This parameter is only available through the DashScope SDK and API.The
qwen3.7-text-embedding, qwen3.7-text-embedding-flash, text-embedding-v4, and text-embedding-v3 models support three vector output types to accommodate different retrieval strategies. The sparse embedding of qwen3.7-text-embedding uses a new SPLADE-like training strategy that improves effectiveness by 8.4% and adds support for cross-language retrieval.
Vector type (output_type) | Advantages | Limitations | Use cases |
|---|---|---|---|
dense | Deep semantic understanding that identifies synonyms and context for more relevant results. | Higher compute and storage costs. Does not guarantee an exact match for keywords. | Semantic search, AI-powered Q&A, content recommendation. |
sparse | High computational efficiency, focusing on an exact match for keywords and enabling fast filtering. | Lacks semantic understanding and cannot process synonyms or context. | Log retrieval, product SKU search, precise information filtering. |
dense&sparse | Combines semantic and keyword matching for optimal search results. The generation cost is unchanged, and the API call overhead is identical to the single-vector mode. | Requires more storage, and the system architecture and retrieval logic are more complex. | High-quality, production-grade hybrid search engine. |
Use cases
The following code is for demonstration purposes only. For production, pre-compute and store embeddings in a vector database. This way, you only need to generate the query embedding for retrieval.
Semantic search
Perform precise semantic matching by calculating the similarity between the query embedding and the document embeddings.
Recommendation system
Analyze a user's behavioral history embeddings to identify their interests and recommend similar items.
Text clustering
Group similar texts by analyzing the distances between their embeddings.
Text classification
Perform zero-shot text classification by calculating the similarity between an input text's embedding and predefined label embeddings. This process classifies text into new categories without requiring pre-labeled examples.
Anomaly detection
Identify anomalous data by calculating the similarity between a text's embedding and the central embedding of normal samples. Data that significantly deviates from this pattern is considered an anomaly.
The threshold in the example is for demonstration purposes. The ideal value varies based on data content and distribution, so you must calibrate it using your own dataset.
API reference
- General text embedding
- Multimodal embedding Multimodal embedding API
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
Rate limiting
For the model's rate limiting conditions, see Rate limiting.
Model performance (MTEB/CMTEB)
Evaluation benchmarks
- MTEB (Massive Text Embedding Benchmark): A comprehensive benchmark that assesses the general-purpose performance of text embeddings on tasks such as classification, clustering, and retrieval.
- CMTEB (Chinese Massive Text Embedding Benchmark): A large-scale benchmark specifically for evaluating Chinese text embeddings.
- Scores range from 0 to 100. Higher scores indicate better performance.
Model | MTEB | MTEB (retrieval task) | CMTEB | CMTEB (retrieval task) |
|---|---|---|---|---|
text-embedding-v1 | 58.30 | 45.47 | 59.84 | 56.59 |
text-embedding-v2 | 60.13 | 49.49 | 62.17 | 62.78 |
text-embedding-v3 (64 dimensions) | 57.40 | 46.52 | 59.19 | 62.03 |
text-embedding-v3 (128 dimensions) | 60.19 | 52.51 | 63.81 | 68.22 |
text-embedding-v3 (256 dimensions) | 61.13 | 54.41 | 65.92 | 71.07 |
text-embedding-v3 (512 dimensions) | 62.11 | 54.30 | 66.81 | 71.88 |
text-embedding-v3 (768 dimensions) | 62.43 | 54.74 | 67.90 | 72.29 |
text-embedding-v3 (1024 dimensions) | 63.39 | 55.41 | 68.92 | 73.23 |
text-embedding-v4 (512 dimensions) | 64.73 | 56.34 | 68.79 | 73.33 |
text-embedding-v4 (1024 dimensions) | 68.36 | 59.30 | 70.14 | 73.98 |
text-embedding-v4 (2048 dimensions) | 71.58 | 61.97 | 71.99 | 75.01 |