Claude Sonnet 5 API

anthropic/claude-sonnet-5
1M tokens · 170 input credits / 1M tokens

Claude 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

Chat with Claude Sonnet 5

Each model has its own conversation. Switching never sends another model's history, and switching back resumes where you left off. Requests are billed from actual token usage.

Ctrl / ⌘ + Enter to send0 / 32,000

Continue with

Claude Sonnet 5

Claude Sonnet 5 accepts an ordered, non-empty messages array and returns generated text plus usage in synchronous JSON or SSE. Give it concrete code, tool definitions, or document context with an explicit output contract for repeatable production work.

Why Choose This?

  • Daily production workloadUse Sonnet for recurring coding, analysis, and structured-response tasks at lower Vidgo rates than Opus.

  • Coding and tool workflowsProvide code context, tool descriptions, and success criteria to guide implementation and external actions.

  • Two compatible protocolsChoose Chat Completions for OpenAI-style clients or Claude Messages for Anthropic-compatible integrations.

Parameters

ParameterRequirementDescription
messagesRequired

A non-empty ordered conversation array; each message provides a role and text content.

max_tokensOptional

Sets the maximum number of tokens returned by Chat Completions and is required by Claude Messages.

streamOptional

Set false for synchronous JSON or true for an ordered SSE event stream.

Defaultfalsetrue

How to Use

  1. Give one concrete taskState the code change, analysis question, or tool-driven outcome and its success criteria.

  2. Include the needed contextAdd the relevant files, reports, prior messages, or business rules without unrelated history.

  3. Define tools and outputDescribe available actions and require the sections or fields the next system step consumes.

  4. Review and iterateCheck code, tool choices, and structured fields against the source context before reuse.

Pricing

Vidgo AI meters input, output, cache-read, and cache-write tokens separately, then settles their sum in credits. Rates below are per 1M tokens.

UsageRateDetails
Input tokens170 credits / 1M tokensInput usage that does not hit prompt cache.
Output tokens855 credits / 1M tokensTokens generated by the model.
Cache read170 credits / 1M tokensInput tokens read from prompt cache.
Cache write170 credits / 1M tokensInput tokens written to prompt cache.

Best Use Cases

  • Daily feature developmentTurn a ticket, relevant source files, and repository conventions into code changes and verification steps.

  • Tool-enabled operations assistantCombine a user request, tool definitions, and policy rules into actions and a structured activity summary.

  • Repository and report analysisUse code excerpts or long reports to extract dependencies, decisions, risks, and next actions.

Pro Tips

  • Describe tool inputs, allowed actions, and success signals explicitly when Sonnet drives an external workflow.
  • Ask for a compact plan before implementation when a coding request spans several files or dependencies.
  • Set the output-token cap from the required deliverable instead of carrying a large default into every production call.

Notes

  • The context window is 1M tokens, and the maximum output is 128K tokens.
  • Claude Sonnet 5 supports both /v1/chat/completions and native /v1/messages; the Playground uses Chat Completions.
  • The minimum positive charge for a successful request is 0.001 credit; requests without valid output are not charged.
  • If a provider returns valid content without usage, the backend estimates token usage for settlement.

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.