Skip to main content
POST
Create a Message

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
Example:

"claude-opus-5"

messages
object[]
required

Input messages. Each message has a role and content.

Minimum array length: 1
Example:
max_tokens
integer
required

The maximum number of tokens to generate before stopping. Claude Opus 5 supports up to 128K output tokens.

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

4096

system

System prompt. Provides context and instructions to Claude.

metadata
object

An object describing metadata about the request.

stop_sequences
string[]

Custom text sequences that will cause the model to stop generating.

stream
boolean
default:false

Whether to incrementally stream the response using server-sent events.

tools
object[]

Definitions of tools that the model may use.

tool_choice
object

How the model should use the provided tools.

output_config
object

Output controls for models that support adaptive thinking effort.

thinking
object

Adaptive thinking is the default. Manual extended thinking is not supported. Disabling thinking is valid only with low, medium, or high effort; xhigh or max returns a 400 error.

Response

Message created successfully

id
string
required
Example:

"msg_01XFDUDYJgAACzvnptvVoYEL"

type
string
required
Example:

"message"

role
string
required
Example:

"assistant"

content
object[]
required
Example:
model
string
required
Example:

"claude-opus-5"

stop_reason
enum<string>
required

Includes refusal for requests that the model declines.

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

Additional stop information when the serving platform provides it.