Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

Model ID.

Available options:
claude-opus-5-5
Example:

"claude-opus-5-5"

messages
object[]
required

Conversation turns. Pass assistant content blocks, including thinking blocks, back unchanged in multi-turn conversations. Do not prefill the final assistant response.

Minimum array length: 1
Example:
max_tokens
integer
required

Maximum output tokens across thinking and visible response text.

Required range: 1 <= x <= 128000
Example:

4096

system

System prompt. Keep it unchanged when replaying Opus 5.5 thinking blocks.

metadata
object

Request metadata.

stop_sequences
string[]

Custom text sequences that stop generation.

stream
boolean
default:false

Stream message events over SSE.

tools
object[]

Tool definitions available to the model. Keep this array unchanged when replaying Opus 5.5 thinking blocks.

tool_choice
object

Controls whether the model may use tools.

output_config
object

Output controls. Claude Opus 5.5 defaults to medium effort.

thinking
object

Omit this field or use adaptive thinking. Manual enabled with budget_tokens and disabled return 400.

Response

Message created successfully. A safeguard refusal is also returned with HTTP 200 and stop_reason set to refusal.

id
string
required
Example:

"msg_01XFDUDYJgAACzvnptvVoYEL"

type
enum<string>
required
Available options:
message
role
enum<string>
required
Available options:
assistant
content
object[]
required
Example:
model
string
required
Example:

"claude-opus-5-5"

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

Additional details for a refusal or other stop condition.