Claude Sonnet 4.5
Claude Sonnet 4.5 is Anthropic’s high-performance chat model. Use this endpoint to create chat completions with Claude Sonnet 4.5, with support for streaming, multimodal inputs, tools, and structured output.
Streaming Support
Whenstream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application.
Streaming Response Format:
- Content-Type:
text/event-stream - Each event line starts with
data:followed by JSON - Events contain incremental message deltas
- Final event indicates completion with
finish_reason
Multimodal
Real-time Search
Streaming
Flexible Roles
Unified Media File Format
Tools Parameter
Thetools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects.
Web Access
Web Access
Authorizations
All APIs require authentication via Bearer Token.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately in the management page
Body
An array of message objects. Each message has a role and content.
Unified Media File Format:
In the content array, whether it's images, videos, audio, or other document types, all media files use the same format structure:
- The
typefield is always"image_url" - The
image_urlfield name remains unchanged - The only thing that changes is the
urlvalue, which points to the corresponding media file address
For example: images, videos, audio, PDFs, and other documents all use the same { type: 'image_url', image_url: { url: '...' } } structure.
1If set to true, partial message deltas will be sent as server-sent events. Default is true.
An optional array of tools the model may call.
- Web Access:
{"type": "function", "function": {"name": "googleSearch"}}
Whether to enable thinking for the model. When set to true, the model performs internal thinking (the thinking process is not output in the response). When set to false, the model does not perform thinking. Default is true.
The effort level for the model to use for reasoning. Low effort is faster to respond, high effort is slower to respond but solves more complex problems. Default is "high".
low, high Response
Request successful. Returns the standard chat completion format.
Unique identifier for the chat completion
"chatcmpl-example-123"
Object type
"chat.completion"
Unix timestamp of when the completion was created
1677652288
Model name
"claude-sonnet-4-5"
Array of completion choices
