Skip to main content
POST
/
v3
/
embeddings
Create Embeddings
curl --request POST \
  --url https://api.edenai.run/v3/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>",
  "encoding_format": "float",
  "dimensions": 1,
  "user": "<string>",
  "metadata": {},
  "extra_headers": {}
}
'
{
  "data": [
    {
      "embedding": [
        123
      ],
      "index": 123,
      "object": "<string>"
    }
  ],
  "model": "<string>",
  "object": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  },
  "cost": 123,
  "provider": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt

Use this file to discover all available pages before exploring further.

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.

Unknown top-level fields are forwarded to the underlying provider.

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'.

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.

metadata
Metadata · object

Arbitrary metadata attached to the request.

extra_headers
Extra Headers · object

Additional HTTP headers 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