Claude Opus 4.5 is Anthropic’s flagship chat model for demanding reasoning and writing tasks. Use this endpoint to create chat completions with Claude Opus 4.5, with support for streaming, multimodal inputs, tools, and structured output.
stream: 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:
text/event-streamdata: followed by JSONfinish_reasontools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects.
Web Access
All APIs require authentication via Bearer Token.
Get API Key:
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
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:
type field is always "image_url"image_url field name remains unchangedurl value, which points to the corresponding media file addressFor 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.
{"type": "function", "function": {"name": "googleSearch"}}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 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-opus-4-5"
Array of completion choices