Skip to main content
POST
Openai Embeddings

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
x-deepinfra-service-tier
string | null

Per-request service tier (priority or flex) for clients that cannot set the service_tier body field. The body field wins when both are present; unrecognized values ride the default tier.

xi-api-key
string | null
x-api-key
string | null

Body

application/json
model
string
required

model name

Example:

"thenlper/gte-large"

input
string
required

text or multimodal content to embed; one embedding per item. Each item is either a string, or a list of content parts (text / image_url / input_audio / audio_url / video_url) embedded together in part order, for multimodal embedding models such as google/embeddinggemma-2.

Maximum string length: 1024
Example:
service_tier
enum<string> | null

The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.

Available options:
default,
priority,
flex
fail_fast
boolean
default:false

If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.

input_type
enum<string> | null

Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models.

Available options:
query,
passage,
document
task
enum<string> | null

Task the embedding is optimized for, on models trained with task prompts (e.g. google/embeddinggemma-2). Applied to items containing text; mutually exclusive with input_type.

Available options:
search_query,
document,
question_answering,
fact_checking,
code_retrieval,
classification,
clustering,
sentence_similarity
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