Browse documentation
API reference

Embeddings

Request numeric vectors on models with embedding support.

POST /v1/embeddings

cURL
curl "https://kavren.dev/v1/embeddings" \
  -H "Authorization: Bearer $KAVREN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "deepseek-v4.1-flash-fast",
  "input": [
    "delivery time",
    "shipping estimate"
  ],
  "encoding_format": "float"
}'

The model ID above illustrates the request format. Embedding availability is determined at request time. A model without an embedding route returns 404 and its reservation is released. The entire batch must fit the input budget. Only input tokens are billed on success.

Read vectors

Example response · selected fields
{
  "object": "list",
  "data": [
    {
      "index": 0,
      "object": "embedding",
      "embedding": [
        0.12,
        -0.3
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 4,
    "total_tokens": 4
  }
}

Match each vector to its input using index. For compatible models, send dimensions as a positive integer, or use encoding_format: "base64" to receive encoded float32 data. Use the same model and dimensions for a vector collection.

Search Kavren