Skip to main content

Multimodal-Embedding API details

The multimodal embedding model converts text, images, and videos into vector representations in the same semantic space, and supports cross-modal retrieval, content classification, and semantic similarity computation.

Core capabilities

  • Cross-modal retrieval: cross-modal semantic search such as text-to-image search, image-to-video search, and image-to-image search.
  • Semantic similarity computation: measures the semantic similarity between content of different modalities in a unified vector space.
  • Content classification and clustering: intelligent grouping, tagging, and cluster analysis based on semantic vectors.
Key feature: Vectors of all modalities (text, images, and videos) are located in the same semantic space, so cross-modal matching and comparison can be performed directly using methods such as cosine similarity. For more information about model selection and usage, see Text and multimodal embeddings.
qwen3-vl-embedding and multimodal-embedding-v1 are available only in the China (Beijing) region; tongyi-embedding-vision-plus and tongyi-embedding-vision-flash are available only in the Singapore region. When you call the API, you must use the API Key of the corresponding region.

Vector type description

The multimodal embedding model supports two vector generation methods:
  • Independent multimodal vectors: generates an independent vector for each input in contents (text, images, videos, multiple images). For example, if you input one piece of text and one image, two independent vectors are returned. This is suitable for scenarios where different content items are compared one by one, such as image-to-image search and text-to-image search.
  • Fused multimodal vectors: fuses all inputs in contents into one vector to achieve comprehensive cross-modal semantic representation. This is suitable for scenarios that require holistic understanding of multimodal content, such as fusing product images and description text into a unified representation for retrieval. qwen3-vl-embedding enables fusion mode by setting enable_fusion=true. Fusion vectors support the following combinations:
    • Text + image fusion
    • Text + video fusion
    • Multiple images + text fusion (multiple image entries passed in)
    • Image + video + text mixed fusion
tongyi-embedding-vision-plus and tongyi-embedding-vision-flash support only independent vectors.
For model descriptions, selection suggestions, and usage, see Text and multimodal embeddings.

Model Overview

  • Singapore
  • Beijing

Model

Vector dimensions

Text length limit

Image size limit

Video size limit

Unit price (per million input tokens)

Free quota(Note)

tongyi-embedding-vision-plus

1152 (default), 1024, 512, 256, 128, 64

1,024 Token

The size of each image must not exceed 3 MB. Multiple images are supported, with up to 8 images

The video file size must not exceed 10 MB

Images/videos: $0.09

Text: $0.09

1 million tokens

Validity: 90 days from the date of Model Studio activation/model release/application approval (whichever is later)

tongyi-embedding-vision-flash

768 (default), 512, 256, 128, 64

Image/Video: $0.03

Text: $0.09

Input formats and language restrictions:

Multimodal fusion embedding model
ModelTextImageVideoNumber of items per request
qwen3-vl-embeddingSupports 33 mainstream languages, including Chinese, English, Japanese, Korean, French, and German
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, Hebrew.
JPEG, PNG, WEBP, BMP, TIFF, ICO, DIB, ICNS, SGI (URL or Base64 supported)MP4, AVI, MOV (URL only)The total number of content elements in a single request must not exceed 20; the number of images must not exceed 5; images, text, and videos share this limit.
Multimodal independent embedding model
ModelTextImageVideoNumber of items per request
tongyi-embedding-vision-plusChinese/EnglishJPG, PNG, BMP (URL or Base64 supported)MP4, MPEG, AVI, MOV, MPG, WEBM, FLV, MKV (URL only)Currently there is no limit on the number of input content elements, as long as the total token count of the input does not exceed the maximum number of tokens.
tongyi-embedding-vision-flash
multimodal-embedding-v1The total number of content elements passed in a single request must not exceed 20; images and videos are each limited to 1, and text is limited to 20, sharing the total limit.
All models support the three input types text, image, and video, as well as their combinations. tongyi-embedding-vision-plus and tongyi-embedding-vision-flash additionally support multi_images multi-image sequence input.

Model capability comparison

Model

Default dimensions

Vector type

Supported inputs

Description

qwen3-vl-embedding

2560

Independent / Fused

text, image, video, multiple image entries

Fusion mode is enabled through the enable_fusion parameter, which fuses multimodal inputs into 1 embedding

tongyi-embedding-vision-plus

1152

Independent only

text、image、video、multi_images

Supports multi_images multi-image sequences (up to 8 images)

tongyi-embedding-vision-flash

768

multimodal-embedding-v1

1024

text、image、video

The dimension parameter is not supported; the dimension is fixed at 1024

Prerequisites

You must have already obtained and configured an API Key and configured the API Key in environment variables. If you call the API through an SDK, you also need to install the DashScope SDK. Replace DASHSCOPE_API_HOST in the sample code with the obtained API Host.

HTTP invocation

POST https://dashscope.aliyuncs.com/api/v1/services/embeddings/multimodal-embedding/multimodal-embedding

Request

  • Multimodal independent embeddings
  • Multimodal fused embeddings
The following example uses the tongyi-embedding-vision-plus model to generate independent embeddings (each input generates its own embedding). You can also replace it with another model name. The multi_images type is supported only by tongyi-embedding-vision-plus and tongyi-embedding-vision-flash. qwen3-vl-embedding additionally supports the fused embedding mode, which is enabled by setting enable_fusion=true. For more information, see the "Multimodal fused embeddings" tab.
curl --silent --location --request POST 'https://dashscope.aliyuncs.com/api/v1/services/embeddings/multimodal-embedding/multimodal-embedding' \
    --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
        "model": "tongyi-embedding-vision-plus",
        "input": {
            "contents": [
                {"text": "多模态向量模型"},
                {"image": "https://img.alicdn.com/imgextra/i3/O1CN01rdstgY1uiZWt8gqSL_!!6000000006071-0-tps-1970-356.jpg"},
                {"video": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250107/lbcemt/new+video.mp4"},
                {"multi_images": [
                    "https://img.alicdn.com/imgextra/i2/O1CN019eO00F1HDdlU4Syj5_!!6000000000724-2-tps-2476-1158.png",
                    "https://img.alicdn.com/imgextra/i2/O1CN01dSYhpw1nSoamp31CD_!!6000000005089-2-tps-1765-1639.png"
                    ]
                  }
            ]
        }
    }'

Request headers

Content-Typestring(Required)Request content type. This parameter must be set to application/json.
Authorizationstring(Required)Request authentication. The API uses an Alibaba Cloud Model Studio API Key for authentication. Sample value: Bearer sk-xxxx.

Request body

modelstring(Required)Model name. Set it to a model name from Model Overview.
inputobject(Required)Input content.

Property

contentsarray(Required)The list of content to be processed. Each element is a dictionary or string that specifies the type and value of the content. The format is {"modal type": "input string or image/video URL"}. Four modal types are supported: text, image, video, and multi_images.
qwen3-vl-embedding supports both fused and independent embedding generation. On top of multimodal independent embeddings, add the bool field enable_fusion; when enable_fusion=true, the fused embedding is returned.
  • Text: the key is text. The value is a string. You can also pass a string directly without using a dict.
  • Image: the key is image. The value can be a publicly accessible URL, or a Base64-encoded Data URI. The Base64 format is data:image/{format};base64,{data}, where {format} is the image format (such as jpeg, png), and {data} is the Base64-encoded string.
  • Multiple images: only the tongyi-embedding-vision-plus and tongyi-embedding-vision-flash models support this type. The key is multi_images, and the value is a list of multiple image sequences, each item being one image, with format requirements as shown above.
  • Video: the key is video, and the value must be a publicly accessible URL.
parameters object (Optional)Embedding processing parameters. For HTTP calls, wrap them in the parameters object; for SDK calls, use the following parameters directly.

Property

output_type string (Optional)The output embedding representation format specified by the user. Currently only dense is supported. If other values are passed, no error is reported; the parameter is ignored and dense is returned.dimension integer (Optional)Used to specify the output vector dimensions. Different models support different values:
  • qwen3-vl-embedding supports 2560, 2048, 1536, 1024, 768, 512, 256; the default value is 2560;
  • tongyi-embedding-vision-plus supports 64, 128, 256, 512, 1024, 1152; the default value is 1152;
  • tongyi-embedding-vision-flash supports 64, 128, 256, 512, 768; the default value is 768;
  • multimodal-embedding-v1 does not support this parameter and always returns 1024-dimensional embeddings.
fps float (Optional)Controls the number of video frames. The smaller the ratio, the fewer frames are actually extracted. The range is [0,1]. The default value is 1.0. Values outside this range do not cause an error.instruct string (Optional)Adds a custom task description, which can guide the model to understand the query intent. It is recommended to write it in English, which typically brings about a 1%–5% performance improvement.enable_fusion bool (Optional)Whether to generate fused embeddings. Only the qwen3-vl-embedding model supports this parameter. When set to true, all multimodal content in contents is fused into one embedding; the default is false, where each modality generates an independent embedding. Fused embeddings support combinations such as text + image, text + video, multiple images + text (passing multiple image items), and image + video + text, making them suitable for retrieval scenarios that require comprehensive understanding of multimodal content.

Response

  • Successful response
  • Error response
{
    "output": {
        "embeddings": [
            {
                "index": 0,
                "embedding": [
                    -0.026611328125,
                    -0.016571044921875,
                    -0.02227783203125,
                    ...
                ],
                "type": "text"
            },
            {
                "index": 1,
                "embedding": [
                    0.051544189453125,
                    0.007717132568359375,
                    0.026611328125,
                    ...
                ],
                "type": "image"
            },
            {
                "index": 2,
                "embedding": [
                    -0.0217437744140625,
                    -0.016448974609375,
                    0.040679931640625,
                    ...
                ],
                "type": "video"
            }
        ]
    },
    "usage": {
        "input_tokens": 903,
        "input_tokens_details": {
            "image_tokens": 896,
            "text_tokens": 7
        },
        "output_tokens": 3,
        "total_tokens": 906
    },
    "request_id": "1fff9502-a6c5-9472-9ee1-73930fdd04c5"
}
The usage field returned by different models varies. Refer to the following descriptions:
  • tongyi-embedding-vision-* series models: return input_tokens (the total of text and image tokens), input_tokens_details (including image_tokens and text_tokens), output_tokens, and total_tokens. The response example above corresponds to this type of model.
  • qwen3-vl-embedding: returns only input_tokens (text tokens only, including system template tokens), image_tokens, and total_tokens (= input_tokens + image_tokens). Does not return input_tokens_details or output_tokens. Example:
{
    "usage": {
        "input_tokens": 43,
        "image_tokens": 1247,
        "total_tokens": 1290
    }
}
  • multimodal-embedding-v1: returns input_tokens, image_tokens, image_count, and duration, and does not return total_tokens, input_tokens_details, or output_tokens.
outputobjectTask output information.

Property

embeddingsarrayThe list of vector results, where each object corresponds to one element in the input list.

Property

indexintThe index of the result in the input list.embeddingarrayThe generated vector array, whose dimensions depend on the model and the dimension parameter setting.typestringThe input type corresponding to the result. text, image, video, and multi_images correspond to text, image, video, and multiple-image inputs respectively. The following are special types: fusion is the type returned by the qwen3-vl-embedding model in fusion vector mode; vl is the type returned by the qwen3-vl-embedding model in separate vector mode.
request_idstringThe unique identifier of the request. It can be used for tracing request details and troubleshooting.
codestringThe error code of a failed request. This parameter is not returned when the request succeeds. For more information, see Error codes.
messagestringThe detailed information of a failed request. This parameter is not returned when the request succeeds. For more information, see Error codes.
usageobjectOutput information statistics.

Property

input_tokensintThe number of Tokens in the input content of this request. For the qwen3-vl-embedding model, this value only includes text Tokens (including system template Tokens) and excludes image/video Tokens; for the tongyi-embedding-vision-* series models, this value is the sum of text and image/video Tokens.input_tokens_detailsobjectDetailed breakdown of input Tokens. Only the tongyi-embedding-vision-* series models return this field; qwen3-vl-embedding and multimodal-embedding-v1 do not return this field.

Property

image_tokensintThe number of Tokens consumed by the visual parts such as images or videos in the input content, excluding text (see text_tokens for the text part). The number of Tokens consumed by an image depends on its resolution: the higher the resolution, the more Tokens consumed; if the input is a video, the system first extracts frames from the video and then calculates Tokens based on the frame extraction results.text_tokensintThe number of Tokens consumed by the text part of the input content (excluding visual parts such as images or videos).
output_tokensintThe number of Tokens output by this request. Only the tongyi-embedding-vision-* series models return this field; other models do not return this field.total_tokensintThe total number of input and output Tokens. For the qwen3-vl-embedding model, total_tokens = input_tokens + image_tokens. Only qwen3-vl-embedding and tongyi-embedding-vision-* series models return this field; multimodal-embedding-v1 does not return this field.image_tokensintThe number of Tokens consumed by the visual parts such as images or videos in the input of this request (excluding text). The number of Tokens consumed by an image depends on its resolution; the system extracts frames from input videos, with the frame count capped by system configuration, and then calculates Tokens based on the processing results. Only qwen3-vl-embedding and multimodal-embedding-v1 return this field (as a top-level field); for the tongyi-embedding-vision-* series models, image Tokens are included in input_tokens_details.image_tokens.image_countintThe number of images input in this request. Only multimodal-embedding-v1 returns this field.durationintThe duration (in seconds) of the video input in this request. Only multimodal-embedding-v1 returns this field.

SDK usage

The input parameter of the SDK corresponds to input.contents in the HTTP request body, and their structures are inconsistent.

Sample Code

  • Image embedding example
  • Video embedding example
  • Text embedding example
  • Fused embedding example
  • Multi-image fused embedding example
  • 2026-03-06 snapshot version example
  • dashscope CLI
  • Use an image URL
  • Use a local image
import os
import dashscope
from dashscope import DashScopeError
# This configuration is for the Singapore region. Replace {WorkspaceId} with your actual workspace ID. The region value varies by region.
client = dashscope.Client(
    # If the environment variable is unset, replace the next line with your Model Studio API key: api_key="sk-xxx",
    # API keys differ by region. Get an API key: see https://www.alibabacloud.com/help/model-studio/regions
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    workspace="{WorkspaceId}",
    region="ap-southeast-1",
)
# Replace with your image URL.
image = "https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png"
input = [{'image': image}]
try:
    # Call the model API.
    resp = client.multimodal.embeddings.create(
        model="tongyi-embedding-vision-plus",
        input=input
    )
    # Embedding result: resp.embeddings[i].embedding is the embedding vector, and resp.embeddings[i].index is the input index.
    print(resp.model_dump_json(indent=4))
except DashScopeError as e:
    print(f"HTTP返回码:{e.status_code}")
    print(f"错误码:{e.code}")
    print(f"错误信息:{e.message}")
    print("请参考文档:https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")

Sample Output

{
    "request_id": "40532987-ba72-42aa-a178-bb58b52fb7f3",
    "embeddings": [
        {
            "index": 0,
            "embedding": [
                -0.009490966796875,
                -0.024871826171875,
                -0.031280517578125,
                ...
            ],
            "type": "text"
        }
    ],
    "usage": {
        "input_tokens": 10,
        "input_tokens_details": {
            "image_tokens": 0,
            "text_tokens": 10
        },
        "output_tokens": 1,
        "total_tokens": 11
    }
}

Error codes

If a model call fails and returns an error message, see Error codes for troubleshooting.