Skip to content

Embeddings

POST https://api.katara.com/v1/embeddings takes the OpenAI embeddings request and returns one vector per input. The model is katara/bge-base-en-v1.5@1, an English model with 768 dimensions.

Terminal window
curl https://api.katara.com/v1/embeddings \
-H "Authorization: Bearer $KATARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"katara/bge-base-en-v1.5@1","input":["The first passage.","The second passage."]}'

With the OpenAI client, client.embeddings.create(model="katara/bge-base-en-v1.5@1", input=[...]) works unchanged.

Field
modelkatara/bge-base-en-v1.5@1.
inputA string, or a list of up to 100 strings. Each input is read up to 512 tokens. Token arrays are not accepted.
encoding_formatfloat (the default) or base64, little-endian 32-bit floats as OpenAI sends them.
dimensionsOnly 768. The model cannot shorten its vectors.
userAccepted and not passed on.

Any other field is refused with 400 and code unsupported_parameter. /v1/models lists the model with its dimensions, max_input_tokens, max_inputs and price.

{
"object": "list",
"data": [{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456] }],
"model": "katara/bge-base-en-v1.5@1",
"usage": { "prompt_tokens": 9, "total_tokens": 9 },
"katara": { "cost_usdc": "0.000001", "provider": "managed", "fallback": true, "served": { "model": "katara/bge-base-en-v1.5@1", "managed": true } }
}

usage.prompt_tokens is what you are charged for: the count the model reports, or, when it reports none, one token for every four bytes of an input plus two per input, never more than 512 per input.

  • A key that pays with USDC is charged per million input tokens at the price /v1/models lists, settled like a chat reply.
  • A key that pays with Account Credits is charged in credits; katara.cost_usd carries the charge.
  • Without a key, the request is paid with x402: the same quote, schemes, 0.025 USDC minimum and settlement as a chat completion. The quote assumes every input is as long as the model takes, and the settlement charges the tokens counted.

Embeddings are served by Katara’s own models only, never by Katara Community, whatever pays. A failure before the vectors come back is not charged.