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

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.

post
Authorizations
AuthorizationstringRequired

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

Body
objectOptional
or
objectOptional
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: 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?