Skip to content

Create embeddings

POST
/embeddings
curl --request POST \
--url https://api.katara.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "katara/bge-base-en-v1.5@1", "input": [ "The first passage.", "The second passage." ] }'

The OpenAI embeddings request. One vector per input, from katara/bge-base-en-v1.5@1 (768 dimensions, up to 100 inputs of up to 512 tokens each). A key pays with Account Credits or USDC; without a key the call is paid with x402 like a chat completion: the quote assumes every input is as long as the model takes, the settlement charges the tokens counted, at least 0.025 USDC. Embeddings never reach Katara Community. Embeddings describes the fields.

PAYMENT-SIGNATURE
string

Without a key, base64 of the x402 payment payload that signs the quote from a previous 402.

X-PAYMENT
string

The same payload under the header name of the first x402 version, paid with exact.

Media typeapplication/json
object
model
required
string
input
required
Any of:
string
encoding_format
string
default: float
Allowed values: float base64
dimensions

Only the model’s own size.

integer
user

Accepted and not passed on.

string
Example
{
"model": "katara/bge-base-en-v1.5@1",
"input": [
"The first passage.",
"The second passage."
]
}

The vectors.

Media typeapplication/json
object
object
required
string
Allowed value: list
data
required
Array<object>
object
object
string
Allowed value: embedding
index
integer
embedding
Any of:
Array<number>
model
required
string
usage
required
object
prompt_tokens

The tokens charged for.

integer
total_tokens
integer
katara
Any of:

What this reply cost and who produced it.

object
cost_usdc
required

The settled price, in USDC, as a decimal string. For a request paid with x402 it is the charge, the 0.025 USDC minimum included.

string
cost_usd

The Credits charge as a decimal string. This legacy field name is retained for compatibility; display Credits without a dollar sign.

string
billing_method
string
Allowed values: credits usdc
payment

On a request paid with x402, the payment that settles the reply.

object
scheme
string
Allowed values: upto exact
network
string
asset

The token paid.

string
amount

The charge in the token’s base units, the same as amount in PAYMENT-RESPONSE.

string
provider

The provider’s address, or managed when a vendor answered.

string
served

The concrete model behind every successful named-model or Cortex reply.

object
model
required
string
bundleId
string
provider

The address that served, or the managed identity.

string
managed

True when a managed vendor answered.

boolean
reason

named for a selected model, available, pinned, failover:<n> after n models failed before delivering, or managed:<why>.

string
Example
{
"object": "list",
"data": [
{
"object": "embedding"
}
],
"katara": {
"cost_usdc": "0.000018",
"cost_usd": "0.000018",
"billing_method": "credits",
"payment": {
"scheme": "upto",
"network": "eip155:43114",
"amount": "25000"
},
"served": {
"model": "katara/qwen3-coder-30b-a3b@1"
}
}
}
PAYMENT-RESPONSE
string

On a call paid with x402, as for chat completions; amount is the charge.

A field the route does not take (unsupported_parameter, with param), a malformed request (invalid_request), a model that does not produce embeddings (feature_not_supported), or a credits key and a model its credits cannot pay for (model_requires_usdc).

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

Unknown key, or a call to the Test network without one (invalid_api_key).

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

Without a key, a quote (with PAYMENT-REQUIRED) or a payment that does not verify (payment_invalid); with a credits key, insufficient_credits.

Media typeapplication/json
One of:
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
PAYMENT-REQUIRED
string

Base64 of the PaymentRequired object in the body. Present only on a quote.

Unknown model (model_not_found).

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

An upto payment from a wallet that has not approved Permit2 and carries no permit (permit2_allowance_required).

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

A USDC key whose balance cannot cover the call (insufficient_quota), or too many unpaid quotes from one address (quote_rate_limited).

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
Retry-After
integer

The embeddings provider failed (provider_failed) or refused the request (provider_rejected_request). Nothing was charged.

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}

The model cannot be served right now (no_capacity). Retry after Retry-After.

Media typeapplication/json
object
error
required
object
message
required

For people. Wording may change.

string
type
required
string
Allowed values: invalid_request_error insufficient_quota rate_limit_error server_error
code
required

Stable. Branch on this.

string
Allowed values: invalid_api_key model_not_found invalid_request feature_not_supported insufficient_quota account_suspended wrong_environment no_capacity test_network_unavailable payment_invalid permit2_allowance_required quote_rate_limited stateless_only unsupported_parameter provider_failed provider_rejected_request internal_error
param
string | null
Example
{
"error": {
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
Retry-After
integer