##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEYThe model that will complete your prompt.
claude-haiku-4-5-20251001, claude-sonnet-4-5-20250929, claude-opus-4-1-20250805, claude-sonnet-4-20250514, claude-opus-4-5-20251101 "claude-sonnet-4-5-20250929"
Input messages.
Our models are trained to operate on alternating user and assistant conversational turns. When creating a new Message, you specify the prior conversational turns with the messages parameter, and the model then generates the next Message in the conversation. Consecutive user or assistant turns in your request will be combined into a single turn.
Each input message must be an object with a role and content. You can specify a single user-role message, or you can include multiple user and assistant messages.
The maximum number of tokens to generate before stopping.
Note that our models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
x >= 11024
Container parameters with skills to be loaded.
Context management configuration.
MCP servers to be utilized in this request
20An object describing metadata about the request.
Determines whether to use priority capacity (if available) or standard capacity for this request.
auto, standard_only Custom text sequences that will cause the model to stop generating.
Whether to incrementally stream the response using server-sent events.
System prompt.
"Today's date is 2024-06-01."
Amount of randomness injected into the response.
Defaults to 1.0. Ranges from 0.0 to 1.0.
0 <= x <= 11
Configuration for enabling Claude's extended thinking.
How the model should use the provided tools.
Definitions of tools that the model may use.
Only sample from the top K options for each subsequent token.
x >= 05
Use nucleus sampling.
0 <= x <= 10.7
Message object
Unique object identifier.
The format and length of IDs may change over time.
"msg_013Zva2CMHLNnXjNJJKqJ2EF"
Object type.
For Messages, this is always "message".
"message"Conversational role of the generated message.
This will always be "assistant".
"assistant"Content generated by the model.
This is an array of content blocks, each of which has a type that determines its shape.
The model that handled the request.
claude-haiku-4-5-20251001, claude-sonnet-4-5-20250929, claude-opus-4-1-20250805, claude-sonnet-4-20250514 "claude-sonnet-4-5-20250929"
The reason that we stopped.
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal, model_context_window_exceeded Which custom stop sequence was generated, if any.
Billing and rate-limit usage.
Context management response.
Information about the container used in this request.