Creates an embedding vector.
Creates an embedding vector representing the input. Supports both text-only embeddings (via input) and multimodal embeddings (via messages) for compatible models. Provide either input or messages, not both. The request body is limited to 16 MiB total, regardless of content type. Multimodal requests are further limited to a 12 MiB decoded size per inline base64 image and 2048 content parts per message; exceeding any of these returns HTTP 413. Pass large images as a remote http(s) URL instead of inline base64 to stay under the body-size and per-image limits - it does not raise the 2048 content-parts cap.
Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.
Successful operation
The request was rejected before it reached a model. The message names the field at fault.
The request body, an inline base64 media payload, or the number of content parts in a single message, query, or document exceeds a documented limit, or a requested image's width or height is above the maximum supported size. Pass large media as a remote http(s) URL instead of inline base64 - a remote URL is fetched directly by the model and does not count against the request body size.
Rate limit exceeded. This response carries no Retry-After header, so back off exponentially and watch X-RateLimit-Remaining-Requests on successful responses to slow down before reaching the limit. Limits are contract-specific.
The request failed on our side. It may or may not have been carried out, so a retry is safe for idempotent calls.
The platform is temporarily overloaded and is shedding load to stay stable. Retry after the number of seconds indicated by the Retry-After header. This is unrelated to your contract's rate limits.
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: 83
{
"input": [
"The food was delicious and the waiter."
],
"model": "intfloat/e5-large-v2"
}{
"model": "text",
"object": "text",
"data": [
{
"index": 1,
"object": "text",
"embedding": [
1
]
}
],
"usage": {
"prompt_tokens": 1,
"total_tokens": 1
}
}Last updated
Was this helpful?