Skip to main content
POST
Claude messages
Use this section for Claude-native message payloads, multi-turn context, multimodal input, and tool calling.
  • Authenticate with x-api-key and anthropic-version
  • system is a top-level field rather than a message inside messages[]
  • messages[].content uses content blocks and should not be flattened too early
  • Tool use requires explicit tools, and later turns must send back tool_result blocks

Authorizations

x-api-key
string
header
required

Headers

anthropic-version
string
required

Anthropic API version header.

Example:

"2023-06-01"

Body

application/json
model
string
required
Example:

"claude-sonnet-4-5"

max_tokens
integer
required
messages
object[]
required
system
tools
object[]
stream
boolean

Response

Successful Claude message response

id
string
type
enum<string>
Available options:
message
role
enum<string>
Available options:
assistant
model
string
content
object[]
stop_reason
string
stop_sequence
string
usage
object