Claude Sonnet 5 API
anthropic/claude-sonnet-5Claude Sonnet 5 converts conversation messages into code, structured analysis, and tool-oriented responses for daily production work. It combines a 1M-token context with lower Vidgo input and output rates than Opus 5 and supports both Chat Completions and Claude Messages.
Claude Sonnet 5
Anthropic · chat-completions
Quick start
Send one POST request to /v1/chat/completions. Non-streaming calls return the model result and usage directly, with no task creation or status polling.
- Endpoint
- POST /v1/chat/completions
- Model ID
- claude-sonnet-5
- Protocol
- Chat Completions
Request fields
| Field | Requirement | Description |
|---|---|---|
| model | Required | claude-sonnet-5 |
| messages | Required | A non-empty array of conversation messages. |
| max_tokens | Optional | Limits output tokens for this response. |
| stream | Optional | Returns an SSE event stream when true. |
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": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Explain why deterministic retries matter in distributed systems."
}
],
"max_tokens": 1024,
"stream": false
}'Keep API keys on the server. Never expose them in browser code or public repositories.
Continue with
Related Models
Claude Sonnet 5 API — Frequently asked questions
What is the Claude Sonnet 5 API?
Claude Sonnet 5 is developed by Anthropic. It accepts ordered conversation messages and returns generated text plus usage through Vidgo AI.
How do I call the Claude Sonnet 5 API?
Use model claude-sonnet-5 with /v1/chat/completions for OpenAI-style clients or /v1/messages for Claude-compatible clients. Both protocols support direct JSON responses and SSE streaming.
How much does Claude Sonnet 5 cost?
Per 1M tokens, Vidgo charges 170 credits for input, 855 for output, 170 for cache reads, and 170 for cache writes. The minimum positive charge for a successful request is 0.001 credit.
What inputs does Claude Sonnet 5 accept?
Both supported protocols accept a non-empty messages array with role and text content. Chat Completions accepts max_tokens optionally, while Claude Messages requires it.
Which Claude 5 model should I choose?
Choose Sonnet for recurring production coding, tool workflows, and analysis at lower Vidgo token rates. Choose Opus for the most demanding multi-step reasoning, broad agentic coding, and enterprise evidence review.