Skip to main content
POST
/
v1
/
openai
/
embeddings
Openai Embeddings
curl --request POST \
  --url https://api.example.com/v1/openai/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": [
    "I like chocolate"
  ],
  "service_tier": "default",
  "encoding_format": "float",
  "dimensions": 1536
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-deepinfra-source
string | null
user-agent
string | null
xi-api-key
string | null

Body

application/json
model
string
required

model name

Example:

"thenlper/gte-large"

input
string
required

sequences to embed

Maximum string length: 1024
Example:
["I like chocolate"]
service_tier
enum<string> | null

The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).

Available options:
default,
priority
encoding_format
enum<string>
default:float

format used when encoding

Available options:
float,
base64
dimensions
integer | null

The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros.

Required range: x >= 32
Example:

1536

Response

Successful Response