Skip to content

OpenAI-compatible Embeddings API reference

The OpenAI-compatible Embeddings reference, with the request fields, one and several texts, shorter vectors, examples and errors.

Updated October 2, 2026
On this page

Turn text into a vector of numbers, so that texts with close meanings get close vectors. Use it for search by meaning, grouping and classification. This endpoint serves the embedding models with a key for GPT models.

POSThttps://api.5abeer.ai/v1/embeddings

Authentication#

Send your key in the Authorization header as Bearer followed by the key, with the OpenAI-compatible base URL. The OpenAI libraries call this endpoint with client.embeddings.create. A Claude or Gemini key gets not_found_error.

Parameters#

Supported means we pass it to the model; rejected means the request fails, here because the key is for another provider.

ParameterDescriptionClaudeGPTGemini
modelstringrequiredThe embedding model id, as in the models list.ClaudeRejectedGPTSupportedGeminiRejected
inputstring | arrayrequiredOne text, or a list of texts; you get one vector per text, in the same order.ClaudeRejectedGPTSupportedGeminiRejected
dimensionsintegerThe vector length, if you want it shorter than the default.ClaudeRejectedGPTSupportedGeminiRejected
encoding_formatstringfloat for a list of numbers, or base64 for a shorter string.ClaudeRejectedGPTSupportedGeminiRejected
userstringAn id for the end user in your system.ClaudeRejectedGPTSupportedGeminiRejected

Examples#

One text#

curl https://api.5abeer.ai/v1/embeddings \
  -H "Authorization: Bearer $KHABEER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Write a product idea in one sentence."
  }'
Response shape
{
  "object": "list",
  "model": "text-embedding-3-small",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.01,
        0.02,
        0.03,
        0.04,
        0.05,
        0.06,
        0.07,
        0.08
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}

The vector is shortened here.

Several texts, shorter vectors#

curl https://api.5abeer.ai/v1/embeddings \
  -H "Authorization: Bearer $KHABEER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": [
      "How do I export a note?",
      "Can I share a notebook?"
    ],
    "dimensions": 256,
    "encoding_format": "float",
    "user": "user-123"
  }'
Response shape
{
  "object": "list",
  "model": "text-embedding-3-small",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        0.01,
        0.02,
        0.03,
        0.04,
        0.05,
        0.06,
        0.07,
        0.08
      ]
    },
    {
      "object": "embedding",
      "index": 1,
      "embedding": [
        0.02,
        0.04,
        0.06,
        0.08,
        0.1,
        0.12,
        0.14,
        0.16
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}

The vector is shortened here.

The request above was run on the local test stack on 2026-10-02; the reply shows the shape, and its text is an example.

Tips#

  • Send texts in batches as a list in input: one request for many texts is faster than many requests.
  • Use the same model for the texts you store and for the questions you compare with them; vectors from different models don't mix.
  • dimensions gives shorter vectors that take less storage, at a small cost in accuracy.

Errors#

Embedding models#

per 1M tokens

    Official price from the provider's page, checked October 19, 2026.

    All models and prices