Skip to main content
POST
Create an Anthropic message

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

anthropic-idempotency-key
string

Anthropic-compatible idempotency header. Same semantics as Idempotency-Key; used on the /messages endpoint to match Anthropic's conventions.

Maximum string length: 255

Body

application/json
model
string
required
max_tokens
integer
required
Required range: x >= 1
messages
object[]
required
Minimum array length: 1
system

System prompt: a string, or an array of text blocks.

temperature
number
Required range: 0 <= x <= 1
top_p
number
Required range: 0 <= x <= 1
output_config
object
routing
object
tools
object[]

Tool definitions the model may call. Responses include tool_use blocks; return outcomes as tool_result content blocks in a follow-up message.

tool_choice
object

Controls tool use: auto, any, tool, or none.

thinking
object

Extended thinking configuration; translated to the model's reasoning.

stream
boolean

When true, returns Anthropic Server-Sent Events after generation completes. This is not incremental token delivery.

metadata
object

Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks.

context_management
object

Anthropic server-side context-editing config (Claude Code sends it automatically). Accepted for compatibility but ignored — Sail forwards the full context each turn.

Response

Anthropic-compatible message response. Returns a single JSON object by default, or an Anthropic Server-Sent Events stream when stream: true.

id
string
required
type
enum<string>
required
Available options:
message
role
enum<string>
required
Available options:
assistant
content
object[]
required
Minimum array length: 1
model
string
required
stop_reason
enum<string>
required
Available options:
end_turn,
max_tokens,
tool_use,
stop_sequence,
refusal,
model_context_window_exceeded
stop_sequence
string | null
required
usage
object
required