Skip to main content
POST
Create Embeddings

Authorizations

Authorization
string
header
required

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

Body

application/json

OpenAI-compatible POST /v1/embeddings request body, plus minimal Eden extensions.

The providers' own embedding parameters in FORWARDED_FIELDS are forwarded; any other undeclared field is refused (SafeAllowExtra).

routing (from ProviderRoutingBody) and fallbacks are declared so prepare_input reads them validated. Routing policies, router_candidates and session_id are not supported on embeddings; chat, Responses and Anthropic Messages accept them.

input
required

Input to embed: string, list of strings, pre-tokenized list of ints, or pre-tokenized batch (list of int lists). Max 2048 items for OpenAI.

model
string
required

Model identifier in 'provider/model' format, e.g. 'openai/text-embedding-3-small'.

tags
any

Up to 10 key/value labels recorded with this call, for filtering and grouping usage. Merged with the X-EdenAI-Tags header.

Example:
routing
ProviderRoutingPreferences · object | null

How to pick between the providers that serve the requested model. Applies when model is a model name with no provider prefix (e.g. 'gpt-5.5'); ignored for a concrete 'provider/model' id, which already names its provider, except zero_data_retention, which holds every model in the request to it. With model='@edenai' the platform chooses the model too: quality_cost steers that choice, and the provider fields hold the models it picks from as they hold any provider. Your own router_candidates are kept as you listed them.

encoding_format
enum<string> | null
default:float

Output encoding: 'float' (default) or 'base64'.

Available options:
float,
base64
dimensions
integer | null

Reduce output vector size. 3-series models only.

Required range: x > 0
user
string | null

End-user identifier for abuse tracking.

fallbacks
string[] | null

Embedding models to try, in order, if the primary model fails. Each is a 'provider/model' id or a model name with no provider prefix. Example: ['openai/text-embedding-3-small'].

Maximum array length: 11
metadata
Metadata · object | null

Arbitrary metadata attached to the request.

extra_headers
Extra Headers · object | null

Additional HTTP headers forwarded to the provider API.

extra_body
Extra Body · object | null

Additional body fields forwarded to the provider API.

Response

Successful Response

OpenAI-compatible embeddings response + Eden cost and provider fields.

EmbeddingsDataClass (from edenai-apis) already widens data[].embedding to list[float] | str so the base64 wire format validates here too.

data
EmbeddingItem · object[]
required
model
string
required
object
string
required
Allowed value: "list"
usage
Usage · object
required

The usage information for the request.

cost
number | null
provider
string | null