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.
Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.
Request payload for creating embeddings. Provide either input (text-only, batchable)
or messages (multi-modal, single embedding). The two are mutually exclusive.
ID of the model to use.
Qwen/Qwen3-VL-Embedding-8BText input. Either a single string or an array of up to 2048 strings.
Each string must be non-empty. Mutually exclusive with messages.
Format of the returned embedding vectors.
floatPossible values: Opaque identifier for your end user. At most 256 characters. A longer value is rejected with a 400.
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.
Successful operation.
Bad Request
The request sent to the API was malformed.
Unauthorized
The request is missing authorization information or the authorization information provided are expired.
Forbidden
The user issuing the request does not have the needed permissions.
Not Found
The requested model or endpoint does not exist. A model that exists but lacks the capability the request needs is rejected with a 400 instead.
Payload Too Large
The request exceeds a size limit. The request body is limited to 16 MiB, an inline
base64 data URI to 12 MiB decoded, and an uploaded image or mask to 10 MiB. On
/v1/chat/completions, /v1/embeddings, and /v1/rerank, a message, query, or
document is limited to 2048 content parts. Count limits, such as the number of
documents, are stated with each field. Pass large media as a remote HTTP or HTTPS URL
instead of inline base64: a URL does not count against the size limits, though it
still counts as a content part.
Unprocessable Entity
The request was well-formed but contains semantic errors.
Too Many Requests
Your contract's rate limit is exhausted. Wait the number of seconds in Retry-After
before retrying, rather than a delay of your own. The OpenAI SDKs do this
automatically. Limits are contract-specific.
Internal Server Error
The request could not be completed because of an internal error. The request was
not necessarily rejected, so a retry is safe for idempotent calls. If it persists,
quote the value of the X-Request-Id response header when contacting support.
Bad Gateway
The model could not be reached, or stopped before it finished answering. No partial answer is returned in its place, and nothing is billed for it. Retrying is reasonable. An image or video URL in the request whose host cannot be reached, times out or answers with a server error is also answered this way.
Service Overloaded (503)
Too many large requests are already being handled at once. This applies only
to a request above a size threshold, or one sent with chunked transfer
encoding. An ordinary-sized request is never refused this way. Always retry
using the Retry-After header, not a fixed delay, to avoid a synchronized
retry storm. For sustained traffic in media, keep individual requests small:
pass large media in a JSON body as a remote HTTP or HTTPS URL rather than
inline base64, and keep a file upload small, for example by sending audio in
a compressed format such as MP3 or Opus. The message gives the advice that
fits how the request was sent.
Gateway Timeout
The model did not answer within the time allowed for it. The request may
have reached the model and may even have been served, so a retry is only safe for
idempotent calls. Retrying the same request unchanged tends to time out again: the
work itself is usually what was too slow, so prefer a smaller request (fewer or
smaller images, a shorter prompt, a lower n) or a model that can serve it.
Capacity Exhausted (529)
The service is temporarily overloaded. This is a non-standard status,
matching the convention used by other LLM providers for the same
condition: capacity is exhausted, not a client error (429) and not an
outage (503). error.code distinguishes a per-user throttle
(user_overloaded) from a system-wide capacity shortage
(server_overloaded). If you check only the status, treat both
alike. Always retry using the Retry-After header, not a
fixed delay, to avoid a synchronized retry storm.
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?