Create a message
const url = 'https://api.katara.com/v1/messages';const options = { method: 'POST', headers: { 'anthropic-version': '2023-06-01', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"model":"katara/cortex","messages":[{"role":"user","content":[{"type":"text","text":"example","cache_control":{"type":"ephemeral","ttl":"5m"}}]}],"system":[{"type":"text","text":"example","cache_control":{"type":"ephemeral","ttl":"5m"}}],"tools":[{"type":"custom","name":"example","description":"example","input_schema":{"type":"object"},"strict":true,"input_examples":["example"],"eager_input_streaming":true,"allowed_callers":["example"],"defer_loading":false,"cache_control":{"type":"ephemeral","ttl":"5m"}}],"tool_choice":{"type":"auto","name":"example","disable_parallel_tool_use":true},"thinking":{"type":"example"},"output_config":{"effort":"example","format":{}},"output_format":{},"cache_control":{"type":"ephemeral","ttl":"5m"},"context_management":{},"compaction":{},"metadata":{"user_id":"example"},"katara":{"task":"example","session":"example","reset_session":true,"summary":"example","community":true,"knowledge":true,"cache":{},"context_edits":{},"compaction":{}},"max_tokens":1,"stream":false,"temperature":1,"top_p":1,"top_k":1,"stop_sequences":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.katara.com/v1/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'anthropic-version: 2023-06-01' \ --data '{ "model": "katara/cortex", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "example", "cache_control": { "type": "ephemeral", "ttl": "5m" } } ] } ], "system": [ { "type": "text", "text": "example", "cache_control": { "type": "ephemeral", "ttl": "5m" } } ], "tools": [ { "type": "custom", "name": "example", "description": "example", "input_schema": { "type": "object" }, "strict": true, "input_examples": [ "example" ], "eager_input_streaming": true, "allowed_callers": [ "example" ], "defer_loading": false, "cache_control": { "type": "ephemeral", "ttl": "5m" } } ], "tool_choice": { "type": "auto", "name": "example", "disable_parallel_tool_use": true }, "thinking": { "type": "example" }, "output_config": { "effort": "example", "format": {} }, "output_format": {}, "cache_control": { "type": "ephemeral", "ttl": "5m" }, "context_management": {}, "compaction": {}, "metadata": { "user_id": "example" }, "katara": { "task": "example", "session": "example", "reset_session": true, "summary": "example", "community": true, "knowledge": true, "cache": {}, "context_edits": {}, "compaction": {} }, "max_tokens": 1, "stream": false, "temperature": 1, "top_p": 1, "top_k": 1, "stop_sequences": [ "example" ] }'Text, images, documents, tools, web search and thinking through the same payment rules
as Chat Completions. Any model name is accepted and 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. Thinking settings, cache markers, context management and beta
headers are accepted; server tools Katara does not run are refused naming the feature.
See Messages.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Optional. Any other value is refused.
Accepted with any value.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
The last message must be from the user; assistant prefill is refused.
object
object
object
object
Base64 with media_type (image/jpeg, image/png, image/gif or image/webp) and data; url with an https url; or file with a file_id.
object
object
object
Base64 PDF, text, content blocks or file with a file_id. A url source is refused.
object
object
object
object
object
object
object
object
object
Text, image, document and search_result blocks.
object
object
object
Empty on Katara’s replies; any value is accepted in history.
Accepted in history and dropped.
object
object
object
object
object
object
object
object
A client tool.
object
object
object
An Anthropic versioned client tool, expanded into an ordinary tool with its published name and schema.
object
object
Web search, run by Katara; the model calls after the first search run on managed models. At most five searches per request. A request that ends without an answer is charged nothing for its searches or the calls after them.
object
Lowers the cap of five.
Not with allowed_domains.
object
object
object
Required with type tool; must name a declared tool.
True gets at most one tool call per reply.
Accepted in every form and ignored; Katara Cortex decides how much the model reasons.
object
object
Accepted and ignored.
A JSON schema output format.
object
A JSON schema output format.
object
object
clear_tool_uses_20250919, clear_thinking_20251015 and compact_20260112 edits, served by Katara’s context management.
object
Served by Katara’s compaction.
object
object
Discarded before inference.
object
Opaque routing token from the last served reply; it grants no payment authority.
Start a new routing session explicitly.
A short step summary, limited to 80 words by Katara Cortex.
As katara.cache on Chat Completions.
object
As katara.context_edits on Chat Completions.
object
As katara.compaction on Chat Completions.
object
0 answers an empty message without running a model.
Accepted and not sent to a model.
Applied by Katara; the reply ends before the first match.
Responses
Section titled “Responses”A message, or named server-sent events ending in message_stop after final usage and cost.
object
object
object
object
Base64 with media_type (image/jpeg, image/png, image/gif or image/webp) and data; url with an https url; or file with a file_id.
object
object
object
Base64 PDF, text, content blocks or file with a file_id. A url source is refused.
object
object
object
object
object
object
object
object
object
Text, image, document and search_result blocks.
object
object
object
Empty on Katara’s replies; any value is accepted in history.
Accepted in history and dropped.
object
object
object
object
object
object
The matched stop sequence when stop_reason is stop_sequence.
object
Input tokens neither read from nor written to the cache.
object
Charged searches; 0 when the request ended without an answer.
The charge and session token, as on Chat Completions.
object
Example
{ "type": "message", "role": "assistant", "model": "katara/cortex", "content": [ { "type": "text", "cache_control": { "type": "ephemeral", "ttl": "5m" } } ], "stop_reason": "end_turn"}Message_start, content_block_start/delta/stop, message_delta, message_stop, and ping every ten seconds of silence. Tool arguments use input_json_delta fragments. A web search opens a server_tool_use block when it starts; its web_search_tool_result block follows once it has run. The final message_delta carries authoritative usage and the katara object. An interrupted stream ends with an error event and no message_stop.
Headers
Section titled “Headers”The request id, also in x-katara-request-id.
Malformed input, or a refused feature such as web fetch, code execution, computer use, the MCP connector, thread or prefill. /v1/messages/batches and its sub-paths answer 400 feature_not_supported (invalid_request_error), since Katara runs no message batches. Carries x-should-retry false.
object
object
Example
{ "type": "error"}Missing, expired or invalid key (authentication_error).
object
object
Example
{ "type": "error"}The funds behind the key cannot cover the request (billing_error), with x-should-retry false; or, without a key, an x402 payment challenge.
object
object
Example
{ "type": "error"}The account or environment refuses the request (permission_error).
object
object
Example
{ "type": "error"}No API route at that path (not_found_error).
object
object
Example
{ "type": "error"}The body is over 32 MB (request_too_large).
object
object
Example
{ "type": "error"}Every vendor that could serve the request is rate limiting (rate_limit_error). Retry-After says when to retry.
object
object
Example
{ "type": "error"}Something failed behind Katara (api_error). Check usage before retrying.
object
object
Example
{ "type": "error"}No candidate could serve the request in time (overloaded_error). Retry-After says when to retry.
object
object
Example
{ "type": "error"}