TokenLab

Text

Create Multimodal Embeddings

Creates embedding vectors with a multimodal embedding model

POST
/v1/multimodal/embeddings

Overview

Use this endpoint with models whose details list the multimodal-embedding operation. Read supported_operations in GET /v1/models/{model} before you send a request. Text-only embedding models use Create Embedding, and this endpoint returns 400 unsupported_endpoint for them.

Only text input is active. A request with image_url or image_base64 returns 400 image_input_deferred.

Request Body

modelstringrequired

ID of a model that lists multimodal-embedding, such as qwen3-vl-embedding.

inputobject | arrayrequired

One input item, or an array of items. Each item needs at least one of the fields below, and the response has one entry per item.

  • text (string): Text to embed.
  • image_url (string): Public image URL. Not active yet.
  • image_base64 (string) and image_mime_type (string): Base64 image data and its MIME type. Not active yet.
dimensionsinteger

Number of dimensions of each returned vector, a positive integer. The maximum depends on the model.

Response

objectstring

Always list.

dataarray

One entry per input item.

Each entry contains:

  • object (string): embedding
  • index (integer): Index of the input item
  • text_embedding (array): The vector of a text item. An entry carries one vector field named by its modality: text_embedding, image_embedding, video_embedding, or audio_embedding.
modelstring

Model used.

usageobject

Token usage with prompt_tokens and total_tokens, when the model reports it.

Request

curl -X POST "https://api.tokenlab.sh/v1/multimodal/embeddings" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-vl-embedding",
    "input": [
      {"text": "A red bicycle leaning against a brick wall"},
      {"text": "A city street at night"}
    ]
  }'

The example vector is shortened for readability.

Response

Response
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "text_embedding": [0.0123, -0.0456, 0.0789] },
    { "object": "embedding", "index": 1, "text_embedding": [0.0211, 0.0334, -0.0102] }
  ],
  "model": "qwen3-vl-embedding",
  "usage": { "prompt_tokens": 18, "total_tokens": 18 }
}

Errors

StatusCodeCause
400invalid_requestinput is missing, empty, or an item has none of text, image_url, image_base64
400unsupported_endpointThe model does not list multimodal-embedding
400image_input_deferredAn item contains an image

Handle other statuses as in Handle API errors.

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Headers

X-TokenLab-Delivery-Policy?string

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Value in

  • "auto"
  • "verified"
  • "official"

Request Body

application/json

Response

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json