claude-sonnet-5
Send a structured list of input messages with text and/or image content, and Claude Sonnet 5 will generate the next message in the conversation.
Body
Model ID.
claude-sonnet-5 "claude-sonnet-5"
Input messages. Each message has a role and content.
1[
{
"role": "user",
"content": "Hello, Claude!"
}
]The maximum number of tokens to generate before stopping. Claude Sonnet 5 supports up to 128K output tokens.
1 <= x <= 1280001024
System prompt. Provides context and instructions to Claude.
An object describing metadata about the request.
Custom text sequences that will cause the model to stop generating.
Amount of randomness injected into the response. On Claude Sonnet 5, non-default values return a 400 error.
0 <= x <= 11
Use nucleus sampling. On Claude Sonnet 5, non-default values return a 400 error.
0 <= x <= 1Only sample from the top K options for each subsequent token. On Claude Sonnet 5, non-default values return a 400 error.
x >= 0Whether to incrementally stream the response using server-sent events.
Definitions of tools that the model may use.
How the model should use the provided tools.
Output controls for models that support adaptive thinking effort.
Adaptive thinking configuration. Claude Sonnet 5 uses adaptive thinking by default; use output_config.effort to control depth. Manual extended thinking is not supported.
Response
Message created successfully
"msg_01XFDUDYJgAACzvnptvVoYEL"
"message"
"assistant"
[
{
"type": "text",
"text": "Hello! How can I help you today?"
}
]"claude-sonnet-5"
Includes refusal for requests that the model declines.
end_turn, max_tokens, stop_sequence, tool_use, refusal, null