Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create embeddings

Generate vector embeddings for text or multi-modal input, following the OpenAI Embeddings API, extended with a messages field for multi-modal input.

Provide either input (text only, batchable) or messages (multi-modal, one embedding). The two fields are mutually exclusive. A request with both is rejected with a 400.

post
Authorizations
AuthorizationstringRequired

Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.

Body

Request payload for creating embeddings. Provide either input (text-only, batchable) or messages (multi-modal, single embedding). The two are mutually exclusive.

modelstring · min: 1Required

ID of the model to use.

Example: Qwen/Qwen3-VL-Embedding-8B
inputone ofOptional

Text input. Either a single string or an array of up to 2048 strings. Each string must be non-empty. Mutually exclusive with messages.

string · min: 1Optional
or
string[] · min: 1 · max: 2048Optional
encoding_formatstring · enumOptional

Format of the returned embedding vectors.

Default: floatPossible values:
userstring · max: 256Optional

Opaque identifier for your end user. At most 256 characters. A longer value is rejected with a 400.

dimensionsintegerOptional

Number of dimensions for the returned vectors. Whether a model can shorten its output, and to which sizes, is model-specific. A value the model does not support is rejected with a 400.

Responses
200

Successful operation.

application/json
post/v1/embeddings
POST /v1/embeddings HTTP/1.1
Host: openai.inference.de-txl.ionos.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 94

{
  "model": "Qwen/Qwen3-VL-Embedding-8B",
  "input": "the quick brown fox",
  "encoding_format": "float"
}
{
  "object": "list",
  "model": "Qwen/Qwen3-VL-Embedding-8B",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023,
        -0.0094,
        0.0151
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Last updated

Was this helpful?