Skip to content

Create a response

POST
/responses
curl --request POST \
--url https://api.katara.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "katara/cortex@1", "instructions": "Answer in two sentences.", "input": "What is a Merkle tree?", "max_output_tokens": 200 }'

The OpenAI Responses API request shape. With a key the call is paid as a chat completion with that key, from Account Credits or in USDC under the same rules. Without a key it is paid per request with x402 exactly as a chat completion: the same 402 challenge, the same schemes, the same 0.025 USDC minimum and the same settlement. Send the same body again with the payment in PAYMENT-SIGNATURE.

Calls are stateless, with or without a key. store: true, previous_response_id, conversation, background: true, a stored prompt and item_reference input items are refused with stateless_only before any quote. Send the whole conversation in input. Pay per request with x402 lists what the route takes.

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
instructions
string
max_output_tokens

Bounds the output and therefore the quote.

integer
temperature
number
top_p
number
tools

Function tools only.

Array<object>
object
tool_choice
parallel_tool_calls
boolean
text

format of text, json_object or json_schema.

object
reasoning

effort, for models that reason.

object
stream
boolean
store

Responses are never stored.

boolean
metadata

Returned as sent.

object
Example
{
"model": "katara/cortex@1",
"instructions": "Answer in two sentences.",
"input": "What is a Merkle tree?",
"max_output_tokens": 200
}

The response, or a server-sent event stream of Responses events when stream is true.

object
id
required
string
object
required
string
Allowed value: response
created_at
required
integer
status
required
string
Allowed values: completed incomplete failed
incomplete_details

reason is max_output_tokens when the reply was cut there.

object | null
model
required
string
output
required

A message item with output_text, a reasoning item when the model reasoned, and a function_call item per tool call.

Array<object>
object
store
required
boolean
previous_response_id
null
usage
object
input_tokens
integer
output_tokens
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
{
"id": "resp_7f3a9c2e1b0d",
"object": "response",
"status": "completed",
"store": false,
"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"
}
}
}
x-katara-request-id
string

Request id for support and for matching usage records.

PAYMENT-RESPONSE
string

As for chat completions. amount is absent on a stream; response.completed carries the charge in response.katara.

The call asked for stored state (stateless_only) or used a field the route does not take (unsupported_parameter), with param naming the field in both cases, was malformed (invalid_request), or named a model its key’s 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 set, or a payment that does not verify (payment_invalid); with a credits key, insufficient_credits. As for chat completions.

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"
}
}

Too many unpaid quotes from one address (quote_rate_limited), or a USDC key whose balance cannot cover the call (insufficient_quota). 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

The provider quoted for a named model failed before delivering (provider_failed). Nothing was charged; request a new quote.

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"
}
}

No provider can take the request 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