1. Docs
  2. API reference
  3. Embeddings

Embeddings

POSThttps://api.airoutly.com/v1/embeddings

Turn text into vectors for search and retrieval. Compatible with the OpenAI Embeddings API.

Check the models page firstUse an embedding model ID listed on the models page. If none is listed yet, this endpoint has no model to call.

Request body

ParameterDescription
modelstringrequiredAn embedding model ID from the models page.
inputstring | arrayrequiredOne text, or an array of texts to embed in one request.
dimensionsintegerOutput vector size, on models that support shortening.

Example request

curl https://api.airoutly.com/v1/embeddings \
  -H "Authorization: Bearer $AIROUTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "EMBEDDING_MODEL_ID", "input": ["first text", "second text"]}'

Response

200 OK
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, …] },
    { "object": "embedding", "index": 1, "embedding": [0.0789, 0.0012, …] }
  ],
  "model": "EMBEDDING_MODEL_ID",
  "usage": { "prompt_tokens": 6, "total_tokens": 6 }
}

Embeddings are billed on input tokens only.