Skip to main content
POST
/
v1
/
embeddings
Create embeddings
curl --request POST \
  --url https://api.infery.ai/v1/embeddings \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "text-embedding-3-small",
  "input": "<string>",
  "encoding_format": "float",
  "dimensions": 123
}
'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.0023,
        -0.0094,
        0.0156
      ]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  },
  "credits_used": 1
}
OpenAI-compatible embeddings endpoint.
curl https://api.infery.ai/v1/embeddings \
  -H "Authorization: Bearer $INFERY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Dense vector, please"
  }'
Returns standard { data: [{ embedding: [...], index: 0 }], usage: {...} }.

Supported models

Browse with GET /v1/models?modality=embedding or see Models. OpenAI, Google, Alibaba and open-source embedding models available.

Batching

input can be an array of up to 2 048 strings. Each string is a separate embedding; all share the same pricing.

Dimensionality reduction

On supported models (e.g. text-embedding-3-small, text-embedding-3-large):
{"model": "text-embedding-3-small", "input": "...", "dimensions": 512}

Authorizations

Authorization
string
header
required

API key in format: Bearer inf_***

Headers

x-request-id
string

Optional request ID for tracking

Body

application/json
model
string
required
Example:

"text-embedding-3-small"

input
required
encoding_format
enum<string>
Available options:
float,
base64
dimensions
integer

Response

Embedding result

object
string
Example:

"list"

data
object[]
model
string
Example:

"text-embedding-3-small"

usage
object
credits_used
integer

Credits deducted from the workspace balance for this request

Example:

1