Embeddings
POST
https://api.oneinfer.ai/v1/ula/embeddingsTurn text into vectors for search, retrieval, clustering and recommendations. The request and reply follow OpenAI's embeddings format, so OpenAI's SDKs work with the base URL {BASE_URL}/v1/ula.
Request headers
AuthorizationstringrequiredBearer token for authentication. Format:
Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.Content-Typestringrequiredapplication/json
Request parameters
modelstringrequiredAn embedding model, for example
BAAI/bge-m3 or Qwen/Qwen3-Embedding-8B. The Embeddings type in the model catalog lists them all. Name the model only; OneInfer picks the provider.inputstring | string[]requiredThe text to embed: one string, or up to 2,048 strings. None may be empty. Each model has a longest input; its catalog entry gives it as the context length.
dimensionsintegerReturn shorter vectors. Only models that can shorten their vectors accept it: Qwen3 Embedding, Nemotron 3.5 Embed, Llama Nemotron Embed VL, EmbeddingGemma and BGE M3. Their catalog descriptions say so; other models refuse it with a 400.
encoding_formatstringfloat (the default) returns each vector as a list of numbers; base64 returns it as base64-encoded float32 values, which is smaller.userstringAccepted for OpenAI clients; it isn't sent on.
Good to know
- Vectors come back in
data, in the order ofinput; each item'sindexsays which input it is. - Inputs are text only for now, including for the CLIP and multimodal (VL) models.
- You pay per input token, at the model's price per million tokens.
usage.prompt_tokensis the count.
Example request
POST {BASE_URL}/v1/ula/embeddings
{
"model": "BAAI/bge-m3",
"input": [
"OneInfer routes each request to a provider.",
"Embeddings turn text into vectors."
]
}Response
JSON
200 OK
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0213,
-0.0472,
0.0118
]
},
{
"object": "embedding",
"index": 1,
"embedding": [
-0.0091,
0.0335,
0.0604
]
}
],
"model": "BAAI/bge-m3",
"usage": {
"prompt_tokens": 25,
"total_tokens": 25,
"credits_used": 0.0000275
}
}Error status codes
| Code | Status | Description |
|---|---|---|
200 | OK | The reply is ready; usage.credits_used is what was charged. |
400 | Bad Request | The model isn't an embedding model, or it can't shorten vectors and dimensions was sent. |
401 | Unauthorized | Missing or invalid Authorization header / Bearer token. |
403 | Forbidden | Your account balance is too low. |
422 | Unprocessable Entity | The request body failed validation, for example an empty or missing field. |
502 | Bad Gateway | The provider serving the model failed. Try again later. |
503 | Service Unavailable | The model is busy or unavailable. Retry after a short wait. |