Claude Sonnet 4.5 API
anthropic/claude-sonnet-4.5Claude Sonnet 4.5 Chat turns ordered text and image messages into code, explanations, and analysis for iterative development. Its 200K-token context keeps the task history in view while system instructions and tool definitions help guide each step.
Claude Sonnet 4.5
Anthropic · chat-completions
Quick start
Send a POST request to /v1/chat/completions with anthropic/claude-sonnet-4.5. Choose JSON or SSE with stream, and receive generated content and usage.
- Endpoint
- POST /v1/chat/completions
- Model ID
- anthropic/claude-sonnet-4.5
- Protocol
- Chat Completions
Request fields
| Field | Requirement | Description |
|---|---|---|
| model | Required | anthropic/claude-sonnet-4.5 |
| messages | Required | A non-empty ordered array; each message contains role and content. |
| max_tokens | Optional | A positive integer setting the response output limit; the playground offers 1–65,536. |
| temperature | Optional | Sampling temperature; the playground offers 0–2 and defaults to 1. |
| top_p | Optional | Nucleus sampling probability; the playground offers 0–1 and defaults to 1. |
| stream | Optional | Set true for SSE events; complete JSON is returned by default. |
Response and usage
Successful responses include generated content and usage. Billing settles from actual input, output, and cache tokens.
Streaming
Set stream: true to read SSE. Finalize usage accounting from the terminal usage event.
curl --request POST \
--url https://api.vidgo.ai/v1/chat/completions \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "anthropic/claude-sonnet-4.5",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain why deterministic retries matter in distributed systems."
}
],
"max_tokens": 4096,
"temperature": 1,
"top_p": 1,
"stream": false
}'Keep API keys on the server. Never expose them in browser code or public repositories.
Continue with
Related Models
Claude Sonnet 4.5 API frequently asked questions
What is the Claude Sonnet 4.5 API?
Claude Sonnet 4.5 turns conversation text and image context into useful answers. Its 200K-token context supports connected work. Use anthropic/claude-sonnet-4.5 through Chat Completions or Claude Messages, or try the Playground above.
How can Claude Sonnet 4.5 support agent workflows?
Define the tools available to Claude Sonnet 4.5 with names and input schemas. Your application executes requested tools and sends their results in the next conversation turn.
What context and output sizes does Claude Sonnet 4.5 have?
Claude Sonnet 4.5 has a 200K-token context window and a 64K-token model output limit. In the Playground, max_tokens ranges from 1 to 65,536.
How do I send an image to Claude Sonnet 4.5?
Add an image block to messages.content with the text question it relates to. The model uses both inputs to produce a text answer.
What does Claude Sonnet 4.5 cost on Vidgo AI?
Claude Sonnet 4.5 is $2.40 and 1000 credits per 1M input tokens, and $12.00 and 5000 credits per 1M output tokens. The Pricing section shows both rates.
Which API endpoints can I use for Claude Sonnet 4.5?
Use anthropic/claude-sonnet-4.5 with /v1/chat/completions or /v1/messages. Choose Chat Completions for system-role messages or Messages for a separate system field.