Skip to content

Create a message

POST
/messages
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.

anthropic-version
string
Allowed values: 2023-06-01 2026-10-21

Optional. Any other value is refused.

anthropic-beta
string

Accepted with any value.

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
messages
required

The last message must be from the user; assistant prefill is refused.

Array<object>
>= 1 items
object
role
required
string
Allowed values: user assistant
content
required
One of:
string
system
One of:
string
tools
Array
Any of:

A client tool.

object
type
string
Allowed values: custom
name
required
string
/^[a-zA-Z0-9_-]{1,128}$/
description
string
input_schema
required
object
type
required
Allowed value: object
key
additional properties
any
strict
boolean
input_examples
Array
eager_input_streaming
boolean
allowed_callers
Array<string>
defer_loading
boolean
cache_control
object
type
required
Allowed value: ephemeral
ttl
string
Allowed values: 5m 1h
tool_choice
object
type
required
string
Allowed values: auto none any tool
name

Required with type tool; must name a declared tool.

string
disable_parallel_tool_use

True gets at most one tool call per reply.

boolean
thinking

Accepted in every form and ignored; Katara Cortex decides how much the model reasons.

object
type
string
key
additional properties
any
output_config
object
effort

Accepted and ignored.

string
format

A JSON schema output format.

object
key
additional properties
any
output_format

A JSON schema output format.

object
cache_control
object
type
required
Allowed value: ephemeral
ttl
string
Allowed values: 5m 1h
context_management

clear_tool_uses_20250919, clear_thinking_20251015 and compact_20260112 edits, served by Katara’s context management.

object
key
additional properties
any
compaction

Served by Katara’s compaction.

object
key
additional properties
any
metadata
object
user_id

Discarded before inference.

string
katara
object
task
string
session

Opaque routing token from the last served reply; it grants no payment authority.

string
reset_session

Start a new routing session explicitly.

boolean
summary

A short step summary, limited to 80 words by Katara Cortex.

string
community
boolean
knowledge
boolean
cache

As katara.cache on Chat Completions.

object
key
additional properties
any
context_edits

As katara.context_edits on Chat Completions.

object
key
additional properties
any
compaction

As katara.compaction on Chat Completions.

object
key
additional properties
any
max_tokens
required

0 answers an empty message without running a model.

integer
stream
boolean
temperature
number
<= 1
top_p
number
<= 1
top_k

Accepted and not sent to a model.

integer
stop_sequences

Applied by Katara; the reply ends before the first match.

Array<string>

A message, or named server-sent events ending in message_stop after final usage and cost.

object
id
required
string
type
required
Allowed value: message
role
required
Allowed value: assistant
model
required
string
Allowed value: katara/cortex
content
required
Array
One of:
object
type
required
Allowed value: text
text
required
string
cache_control
object
type
required
Allowed value: ephemeral
ttl
string
Allowed values: 5m 1h
stop_reason
required
string
Allowed values: end_turn max_tokens tool_use stop_sequence refusal
stop_sequence
required

The matched stop sequence when stop_reason is stop_sequence.

string | null
stop_details
object | null
usage
required
object
input_tokens
required

Input tokens neither read from nor written to the cache.

integer
output_tokens
required
integer
cache_read_input_tokens
required
integer
cache_creation_input_tokens
required
integer
server_tool_use
object
web_search_requests

Charged searches; 0 when the request ended without an answer.

integer
katara

The charge and session token, as on Chat Completions.

object
key
additional properties
any
Example
{
"type": "message",
"role": "assistant",
"model": "katara/cortex",
"content": [
{
"type": "text",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
],
"stop_reason": "end_turn"
}
request-id
string

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.

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

Missing, expired or invalid key (authentication_error).

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
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.

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

The account or environment refuses the request (permission_error).

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

No API route at that path (not_found_error).

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

The body is over 32 MB (request_too_large).

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

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

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

Something failed behind Katara (api_error). Check usage before retrying.

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}

No candidate could serve the request in time (overloaded_error). Retry-After says when to retry.

Media typeapplication/json
object
type
required
Allowed value: error
error
required
object
type
required
string
message
required
string
code
required
string
key
additional properties
any
key
additional properties
any
Example
{
"type": "error"
}