OpenAI-compatible Embeddings API reference
The OpenAI-compatible Embeddings reference, with the request fields, one and several texts, shorter vectors, examples and errors.
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.
https:/ / api.5abeer.ai/ v1/ embeddingsAuthentication#
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.
modelstringrequiredThe embedding model id, as in the models list.ClaudeRejectedGPTSupportedGeminiRejectedinputstring | arrayrequiredOne text, or a list of texts; you get one vector per text, in the same order.ClaudeRejectedGPTSupportedGeminiRejecteddimensionsintegerThe vector length, if you want it shorter than the default.ClaudeRejectedGPTSupportedGeminiRejectedencoding_formatstringfloat for a list of numbers, or base64 for a shorter string.ClaudeRejectedGPTSupportedGeminiRejecteduserstringAn id for the end user in your system.ClaudeRejectedGPTSupportedGeminiRejectedExamples#
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."
}'{
"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"
}'{
"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.
dimensionsgives shorter vectors that take less storage, at a small cost in accuracy.
Errors#
invalid_request_error:modelorinputis missing.not_found_error: the key is not for GPT models.- A very long batch can return
413withREQUEST_TOO_LARGE; split it. See Limits.
Embedding models#
Official price from the provider's page, checked October 19, 2026.
All models and pricesWas this page helpful?