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", "input": "Explain a Merkle tree in two sentences.", "max_output_tokens": 200 }'

Text, images, files, function, custom and web search tools. Any model name, or none, is served by Katara Cortex, and the reply names katara/cortex. Without a key, katara/cortex-genius or katara/cortex-smart fix the model and the reply still names katara/cortex; with a key they are refused. Reasoning settings are accepted and change nothing. See Responses.

The response is stored for 30 days unless the request sends store: false. With a key it belongs to the key’s account; without a key it belongs to nobody and whoever holds its id can read, continue or delete it. Without a key the call is paid per request with x402, exactly as a chat completion.

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

Any model name; every one is served by Katara Cortex. Without a key, katara/cortex-genius or katara/cortex-smart fix the model; a request with a key that names either is refused with model_requires_x402.

string
default: katara/cortex
input
required
One of:
string
instructions

Sent as a system message.

string
stream
boolean
store

False keeps the response from being stored.

boolean
default: true
previous_response_id

A stored response to continue from. With a key, one of the account’s; without a key, one stored without a key.

string
conversation
One of:
string
max_output_tokens
integer
>= 1
temperature
number
<= 2
top_p
number
<= 1
tools

function, custom, namespace, tool_search and web_search tools (web_search_preview and dated variants too). file_search, mcp, computer, computer_use, computer_use_preview, code_interpreter, image_generation, local_shell, shell and apply_patch are refused with unsupported_tool.

Array<object>
object
type
required
string
name
string
>= 1 characters
description
string
parameters

JSON Schema for the function arguments.

object
strict
boolean
key
additional properties
any
tool_choice
One of:
string
Allowed values: auto none required
parallel_tool_calls

False gets at most one tool call per reply.

boolean
max_tool_calls

Lowers the cap of five web searches per request.

integer
>= 1
reasoning

Accepted with any effort and changes nothing; Katara Cortex decides how much the model reasons. summary returns reasoning as summary text.

object
key
additional properties
any
text
object
verbosity
string
format
object
type
required
string
Allowed values: text json_object json_schema
name
string
description
string
schema
object
strict
boolean
metadata

Returned with the response; never forwarded to providers. Limits are measured in UTF-8 bytes.

object
<= 16 properties
key
additional properties
string
<= 512 characters
katara

The same controls as on Chat Completions.

object
community

False excludes Katara Community.

boolean
task
string
knowledge
boolean
key
additional properties
any
prompt_cache_key

Keeps a conversation on the model whose cache holds its start.

string
background

Accepted; the response is answered once it is complete.

boolean
truncation
string
include

Accepted. Katara returns no encrypted reasoning.

Array<string>
user

Not forwarded to providers.

string
safety_identifier

Not forwarded to providers.

string
service_tier

Accepted and ignored.

string
prompt_cache_retention

Accepted and ignored.

string
top_logprobs

Accepted and ignored.

integer
stream_options

Accepted and ignored.

object
context_management

Accepted and ignored.

client_metadata

Accepted and ignored.

object
access_programs

Accepted and ignored.

Example
{
"model": "katara/cortex",
"input": "Explain a Merkle tree in two sentences.",
"max_output_tokens": 200
}

A response object, or a named server-sent event stream.

object
id
required
string
object
required
string
Allowed value: response
created_at
required

Unix seconds.

integer
status
required
string
Allowed values: in_progress completed incomplete failed
model
required
string
Allowed value: katara/cortex
previous_response_id
string | null
output
required

Assistant messages with output_text (and url_citation annotations for pages the answer quotes), function_call and custom_tool_call items, reasoning items and web_search_call items with their sources.

Array<object>
object
id
string
type
string
Allowed values: message reasoning function_call custom_tool_call web_search_call
status
string
Allowed values: in_progress completed incomplete
role
string
Allowed value: assistant
call_id
string
name
string
arguments
string
input
string
content
Array<object>
object
type
string
Allowed values: output_text reasoning_text
text
string
annotations
Array<object>
object
key
additional properties
any
key
additional properties
any
key
additional properties
any
usage
required
object
input_tokens
integer
output_tokens
integer
total_tokens
integer
input_tokens_details
object
cached_tokens
integer
cache_write_tokens
integer
output_tokens_details
object
reasoning_tokens
integer
katara
Any of:

What this reply cost.

object
cost_usdc
required

The settled price, in USDC, as a decimal string. For a request paid with x402 it is the charge, the model’s minimum included (0.025 USDC, 0.05 for katara/cortex-genius, 0.01 for katara/cortex-smart).

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
cached_tokens

Prompt tokens the vendor read from its cache, billed at the cached input rate.

integer
cache_saving_usdc

What the cached tokens saved against the input rate, in USDC.

string
cache_saving_usd

The same saving in Credits, on a reply paid with account credits.

string
compaction

When katara.compaction summarised the conversation.

object
message

The system message to send in place of the summarised messages.

object
replaces_from

First index in this request’s messages that the summary replaces.

integer
replaces_to

First index kept after it.

integer
model
string
tokens_before
integer
summary

The summary request’s usage and its cost (cost_usdc or cost_usd).

object
skipped

Why no summary was made; the request went whole.

string
context_edits
object
cleared_tool_results
integer
cleared_tokens
integer
through_turn
integer
cache_written_tokens

Tokens this request wrote to a new explicit cache (katara.cache).

integer
cache_ttl_seconds

How long that cache is kept.

integer
cache_storage_usdc

What keeping it costs, in USDC; included in cost_usdc.

string
simulated

On Test, a reply with fixed text that no model wrote, served when no Test provider was free.

boolean
stop_sequence

The stop sequence at which Katara ended the reply.

string
web_search

The searches this request was charged for.

object
requests

The successful searches; only those are charged, and none when the request ended without an answer.

integer
cost_usdc
string
cost_usd
string
model_calls

On a web search request, how many model calls it made.

integer
web_searches

Every search the model made, in order. Not on stream chunks, which carry each search as it runs.

Array<object>
object
id
required
string
query
required
string
results
required
Array<object>
object
url
string
title
string
page_age
string
content
string
error
string
Allowed values: invalid_input query_too_long too_many_requests unavailable max_uses_exceeded insufficient_quota
edit_id

On an image reply from a model that edits, the id to send as previous_edit_id.

string
metadata
object | null
incomplete_details
object
reason
string
Allowed values: max_output_tokens content_filter
error
object
code
string
message
string
Example
{
"object": "response",
"status": "in_progress",
"model": "katara/cortex",
"output": [
{
"type": "message",
"status": "in_progress",
"role": "assistant",
"content": [
{
"type": "output_text"
}
]
}
],
"katara": {
"cost_usdc": "0.000018",
"cost_usd": "0.000018",
"billing_method": "credits",
"payment": {
"scheme": "upto",
"network": "eip155:43114",
"amount": "25000"
},
"web_searches": [
{
"error": "invalid_input"
}
]
},
"incomplete_details": {
"reason": "max_output_tokens"
}
}
x-katara-request-id
string

The request id.

PAYMENT-RESPONSE
string

Payment result when paid with x402.

Invalid input or a refused feature, with param naming the field. Codes are invalid_json, invalid_type, invalid_value, unsupported_parameter, unsupported_tool and invalid_request.

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}

Missing, expired or invalid key.

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}

The funds behind the key cannot cover the request (insufficient_quota, with x-should-retry false), or, without a key, a quote with PAYMENT-REQUIRED set, as for chat completions, or a payment that does not verify (payment_invalid).

Media typeapplication/json
One of:
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Example
{
"x402Version": 2,
"error": "payment required",
"accepts": [
{
"scheme": "upto",
"network": "eip155:43114",
"asset": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
"amount": "25000",
"maxTimeoutSeconds": 300,
"extra": {
"name": "USD Coin",
"version": "2",
"assetTransferMethod": "permit2"
}
}
]
}
PAYMENT-REQUIRED
string

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

previous_response_id names a response that is missing, expired, deleted or someone else’s (previous_response_not_found), or an item_reference names no stored item (not_found).

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}

Every vendor that could serve the request is rate limiting (provider_rate_limited). Retry-After says when to retry.

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}

Every candidate’s reply was refused or failed. Nothing was charged.

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}

No candidate could serve the request in time (provider_overloaded, upstream_timeout, no_capacity). Retry-After says when to retry.

Media typeapplication/json
object
error
required
object
type
string
code
required

Stable error code.

string
message
required

Explanation for the caller.

string
param
string | null
Examplegenerated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}