Skip to main content
POST
Create a message (Anthropic Messages API)

Authorizations

Authorization
string
header
required

Gateway API key (imp-rt-...) from POST /v1/accounts or /v1/keys.

Body

application/json
model
string
required
Example:

"claude-haiku-4-5"

max_tokens
integer
required

Required by the Anthropic API.

messages
object[]
required
system
string

Top-level system prompt.

stream
boolean
default:false
temperature
number
top_p
number
top_k
integer
stop_sequences
string[]
thinking
object

Anthropic thinking control, preserved on native Anthropic and Bedrock routes.

output_config
object
tools
object[]

Tools the model may call (relay mode — the gateway does not execute them).

tool_choice
object

{ type: auto }, { type: any }, { type: tool, name }, or { type: none }.

Response

A message object. When stream: true, the body is an SSE stream of Anthropic events (message_start, content_block_delta, …, message_stop).

Non-streaming Anthropic message response.

id
string
Example:

"msg_..."

type
string
Allowed value: "message"
role
string
Allowed value: "assistant"
model
string
content
object[]

Text blocks and, when the model calls a tool, tool_use blocks.

stop_reason
enum<string> | null
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use
stop_sequence
string | null
usage
object