Embeddings

POSThttps://api.oneinfer.ai/v1/ula/embeddings

Turn 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

Authorizationstringrequired
Bearer token for authentication. Format: Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.
Content-Typestringrequired
application/json

Request parameters

modelstringrequired
An 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[]required
The 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.
dimensionsinteger
Return 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_formatstring
float (the default) returns each vector as a list of numbers; base64 returns it as base64-encoded float32 values, which is smaller.
userstring
Accepted for OpenAI clients; it isn't sent on.

Good to know

  • Vectors come back in data, in the order of input; each item's index says 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_tokens is 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

CodeStatusDescription
200OKThe reply is ready; usage.credits_used is what was charged.
400Bad RequestThe model isn't an embedding model, or it can't shorten vectors and dimensions was sent.
401UnauthorizedMissing or invalid Authorization header / Bearer token.
403ForbiddenYour account balance is too low.
422Unprocessable EntityThe request body failed validation, for example an empty or missing field.
502Bad GatewayThe provider serving the model failed. Try again later.
503Service UnavailableThe model is busy or unavailable. Retry after a short wait.

Response

202 - application/json