Creates a model response for the given chat conversation using Anthropic API.
The authentication header format is Bearer <API_KEY>, where <API_KEY> is your API token.
Anthropic API version, only valid when using Claude model
Anthropic API beta, only valid when using Claude model
"claude-sonnet-4-5-20250929"
Maximum number of tokens
Whether to stream conversations
temperature
Top-K sampling
5
nuclear sampling
0.7
Model response
"msg_013Zva2CMHLNnXjNJJKqJ2EF"
Reason for stopping operation. This may be one of the following values:
"end_turn": The model reaches a natural stopping point"max_tokens": We exceeded the requested max_tokens value or the model's maximum value"stop_sequence": Generates one of the custom stop_sequences you provide"tool_use": The model calls one or more tools"pause_turn": We paused a long running turn. You can provide this response directly in subsequent requests to allow the model to continue running."refusal": when the streaming classifier steps in to handle a potential policy violationIn non-streaming mode, this value is never empty. In streaming mode, null in the message_start event, non-null otherwise.
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal Did you generate a custom stop sequence?
If so, this value is a non-empty string. If a custom stop sequence was generated, this value is a non-empty string.
null
"message"
Dosage