Claude Sonnet 5 is Anthropic's most capable Sonnet-class model — frontier-level performance across coding, agentic workflows, and professional knowledge work, at a fraction of the cost of the Opus tier. It serves a 1M-token context window with up to 128K output tokens, accepts text, image, and file inputs with text output, and supports adaptive thinking with selectable reasoning effort (low, medium, high, max) so callers can dial the intelligence / latency / cost tradeoff per request. Built as Anthropic's most agentic Sonnet yet, it posts large gains over Sonnet 4.6 on agentic coding and computer-use and closes much of the gap to Opus 4.8 — 63.2% on SWE-bench Pro, 80.4% on Terminal-Bench 2.1, and 81.2% on OSWorld-Verified — while pricing well below Opus 4.8, GPT-5.5, and Gemini 3.1 Pro. It is a strong default for cost-sensitive agents, coding assistants, and high-volume production workloads that still demand frontier reasoning.
Claude Sonnet 5 is an Anthropic model designed for long-context, multimodal tasks. It supports up to 1,000,000 input tokens—enough to cover entire codebases, lengthy documents, or multiple data…
Claude Sonnet 5 excels at code-related tasks, from reading entire codebases to generating complex algorithms. With a 1M-token context, it can ingest multiple files in a single prompt, understand cross-file dependencies, and produce refactored code, debug explanations, or unit tests. It supports popular languages like Python, JavaScript, Java, C++, Go, Rust, and many others, responding in the language of the user's choice. The model can also reason about code execution paths, spot logical errors, and suggest optimizations. For tasks like generating a REST API from a spec, converting a monolithic codebase to microservices, or reviewing a pull request by looking at all changed files at once, Claude Sonnet 5 provides a powerful single-call solution. Its 81.2 OSWorld-Verified score indicates strong performance on operating-system-level benchmarks, further reflecting its code-and-command proficiency.
Claude Sonnet 5 can accept images as inputs—either directly uploaded (as base64 or via URL) or embedded in documents—and reason about their content. It can describe scenes, identify objects, read text from images, and answer visual questions. The image understanding is not limited to static photos; it can process charts, diagrams, screenshots, handwritten notes, and even frames from video (if provided as sequential images). Because the context window is large, many images can be included within one prompt for tasks like visual comparison, multi-page document analysis, or detecting changes across a series of screenshots. The model treats images as part of the conversation history, so it can combine visual cues with textual instructions. Note that image tokenization consumes tokens proportionally to resolution; OrcaRouter automatically handles encoding and sends the data in the format Anthropic expects.
While Claude Sonnet 5 is cost-effective per token for its capabilities, there are situations where a lighter model may be more appropriate. For simple text generation—short emails, social media posts, or basic Q&A—a smaller and cheaper model like Claude Haiku or GPT-4o-mini can deliver adequate results at a fraction of the cost. Similarly, if your workflow involves extremely predictable, low-complexity tasks (e.g., keyword extraction, translation without nuance), the overhead of a large context model is unnecessary. For vision tasks that only require OCR without deep reasoning, a dedicated vision API may be cheaper. Additionally, if your input context consistently stays under 32K tokens, you may not need the 1M window and could use a model with a smaller context but lower per-token price. Always benchmark cost vs. quality for your specific use case.
Claude Sonnet 5 shines in high-context, multimodal scenarios where a single model call must process large or mixed data. Ideal use cases include: analyzing an entire code repository for security vulnerabilities, generating comprehensive documentation from a set of design documents and screenshots, legal contract review across hundreds of pages, medical report analysis combining imaging data and clinical notes, and interactive assistants that maintain long conversation histories (e.g., journaling, therapy, research). Its strong reasoning capabilities also make it suitable for scientific problem-solving, complex data extraction from PDFs, and building intelligent agents that manage multi-step tasks with file attachments. For creative writing that requires consistent voice over many chapters, the large output limit helps produce full drafts in one go. When accessed via OrcaRouter, the zero-markup pricing further lowers the cost of these high-volume use cases.
Claude Sonnet 5 achieved a score of 81.2 on OSWorld-Verified, a benchmark designed to measure a model's ability to perform operating system tasks—such as file operations, command execution, multitasking, and command-line usage—using natural language instructions. A score of 81.2 indicates that the model reliably interprets and executes a wide range of OS-level commands and scenarios. This is relevant for developers building automation tools, AI-assisted DevOps pipelines, and any application that requires the model to function as a competent assistant for operating-system interactions. The benchmark tests both script generation and the ability to understand OS concepts like paths, permissions, and processes. While not a perfect proxy for real-world performance, this score suggests Claude Sonnet 5 is among the top-performing models for agentic code execution and system-level tasks.
Claude Sonnet 5's primary strengths are its large context window (1M tokens), high output limit (128K tokens), strong multimodal reasoning, and OS-level competence (81.2 OSWorld-Verified). It handles long documents, complex codebases, and mixed inputs with high coherence. However, like all models, it has limitations. The effective context may degrade in performance at the very end of the window; Anthropic recommends staying under ~900K tokens for best results. The model may struggle with highly nuanced cultural references, generating factual data (it can hallucinate numbers), and tasks requiring real-time knowledge beyond its training cutoff (Anthropic has not disclosed the exact cutoff, but it is approximately early 2025). Vision capabilities are good but not state-of-the-art for fine-grained object detection. Pricing, while zero-markup, is still higher than smaller models. Latency is typical for a large model—responses can be slower due to the large context processing.
Latency for Claude Sonnet 5 depends heavily on the input size and output length. With a 1M-token context, the initial prompt processing can take several seconds to minutes, as the model must attend to the entire window. Once processing begins, token generation speed is typically in the range of 20-40 tokens per second (depending on load and provider infrastructure). Smaller inputs (e.g., a few hundred tokens) will see faster first-token latency, often under a second. Streaming is enabled by default through OrcaRouter's API, allowing you to see output tokens as they are generated. For latency-sensitive applications (e.g., real-time chat), you may want to use a smaller model or trim the context. OrcaRouter does not add significant latency beyond Anthropic's own API—the overhead is negligible as it brokers the request to Anthropic's endpoints.
Anthropic has not publicly released a comprehensive benchmark suite for Claude Sonnet 5 at the time of writing. The only provided figure is 81.2 on OSWorld-Verified. For general reasoning, the model likely performs in line with other Claude Sonnet models on standard NLP benchmarks like MMLU, HumanEval, and GSM8K, but exact scores are not available from the provider. In practice, early user reports suggest strong performance on code generation, document QA, and long-context retrieval tasks. We recommend running your own evaluation against your specific use case, as benchmarks can be misleading. OrcaRouter allows you to test the model quickly via its API without upfront cost—simply set the model id to "anthropic/claude-sonnet-5" and start prompting to gauge performance for your data.
Claude Sonnet 5 on OrcaRouter is billed at Anthropic's provider rate with zero markup: $2.00 per 1 million input tokens and $10.00 per 1 million output tokens. Both input and output tokens are counted as standard text tokens (images and files are tokenized per Anthropic's scheme). There are no additional fees for authentication, rate limits, or data transfer. OrcaRouter charges based on the raw token count reported by Anthropic; this includes any system prompt, user messages, image tokens, and generated response. Billing is usage-based and you only pay for what you consume. For heavy users, this transparent model avoids surprise fees. There is no minimum spend or contract required—you simply add credits or set up billing at OrcaRouter's dashboard, and your usage is deducted at the above rates.
Claude Sonnet 5's pricing ($2/$10 per 1M tokens) is between Anthropic's cheaper models (like Haiku at $0.25/$1.25) and its premium models (like Claude Opus at $15/$75). For long-context tasks, the cost per million tokens is relatively low given the 1M capacity. However, if you use the entire context window, the absolute cost per query can add up—a full 1M input token request costs $2.00 just for input. Compare that to using a smaller context model like GPT-4o-mini ($0.15/$0.60) for short queries. The trade-off: Claude Sonnet 5 offers higher reasoning quality and larger capacity but at a higher per-token price. For tasks that genuinely require the large context or multimodal reasoning, the model can be more efficient than splitting work across multiple API calls. OrcaRouter's zero-markup ensures you are not paying extra with middleman fees, so the comparison is directly to other providers.
OrcaRouter does not currently offer a separate prompt caching layer for Claude Sonnet 5; all tokens are billed at the standard input rate. While Anthropic's own API may support prompt caching for some models (reducing cost for repeated prefixes), OrcaRouter passes tokens at the same price regardless of repetition. In practice, if you send the exact same large system prompt repeatedly, you will still be charged for the input tokens each time. There is no discount for cached context. This is important to consider if your workflow involves static, lengthy instructions—it may be more cost-effective to run a smaller model or use a different architecture. However, OrcaRouter's zero-markup means you are not paying extra overhead; the cost is purely Anthropic's listed price. Future caching features may be added, but as of now, pricing is per-call based on the full token count.
If you send an input that exceeds the 1,000,000 token context window, OrcaRouter will return an error (typically a 400 status with a message about context length). The model will not truncate the input; you must manually manage token counts. For the output, if the model reaches the maximum of 128,000 tokens before finishing, it will stop generating and return a finish_reason of "length" (in the API response). You can then continue the conversation by sending a new request with the accumulated output as history. OrcaRouter does not automatically retry or split your request; it is your responsibility to stay within limits. Tools like tiktoken can help estimate token counts for your prompts. For very long inputs, consider chunking or using a sliding window approach, although Claude Sonnet 5's large context often eliminates the need for chunking.
To use Claude Sonnet 5 through OrcaRouter, set the base URL to https://api.orcarouter.ai/v1 and use the model ID "anthropic/claude-sonnet-5". The API is fully compatible with OpenAI's chat completions format, so you can use existing OpenAI client libraries. For example, in Python with the openai package: set api_key to your OrcaRouter key, base_url to the OrcaRouter endpoint, and model to "anthropic/claude-sonnet-5". You can send messages with role, content (text and/or image_url parts for vision). The response will contain standard fields: id, object, choices, usage (prompt_tokens, completion_tokens). Streaming is supported by setting stream=True. OrcaRouter handles authentication and routes your request to Anthropic's backend. No additional configuration is needed—just your API key and the correct model identifier.
You can use the standard OpenAI-compatible parameters with OrcaRouter: messages (required), model (required, set to "anthropic/claude-sonnet-5"), temperature (0-2, default 1), top_p (0-1, default 1), max_tokens (default 4096, up to 128000), stop sequences (array of strings), frequency_penalty, presence_penalty (both -2 to 2), and stream (boolean). Additionally, you can pass Anthropic-specific parameters via the extra_headers field—for example, anthropic-version to specify API version. OrcaRouter automatically adds required Anthropic headers. For multimodal messages, include content as a list of parts with type text or image_url. Note that the model supports tools/functions (parallel tool calling). The response includes finish_reason, usage statistics, and choices. There is no separate parameter for context window size; the model inherently uses its 1M capacity.
Migration is straightforward because OrcaRouter provides an OpenAI-compatible API. If you are already using OpenAI's API, simply change the base_url to https://api.orcarouter.ai/v1 and modify the model parameter to "anthropic/claude-sonnet-5". Your existing code for constructing messages, handling streaming, and parsing responses should work without changes—OrcaRouter returns standard OpenAPI-compliant responses. If you were using a different provider like Anthropic's native API (which uses a different format), you may need to adapt your message schema to the OpenAI format (roles: system, user, assistant). OrcaRouter's docs provide migration guides. Key differences: Claude Sonnet 5 supports system messages, tools, and multimodal parts. Ensure your input does not exceed the 1M token limit. Start with a small test call to confirm connectivity and understand latency before scaling.
Claude Sonnet 5 improves upon its predecessor primarily in context window size (1M vs. 200K tokens) and output limit (128K vs. 8K), making it far better suited for long-document and codebase analysis. It also introduces file input support alongside text and image, while Sonnet 4 was limited to text and images. Benchmarks between the two are not directly published, but OSWorld-Verified score of 81.2 for Sonnet 5 indicates a significant step forward in OS-level task execution. Pricing has increased—Sonnet 4 input cost was $3/M tokens, Sonnet 5 is $2/M—so it is actually cheaper per input token. Output is $10/M vs. Sonnet 4's $15/M, a 33% reduction. Overall, Sonnet 5 offers better value for most use cases, especially those requiring large context. However, Sonnet 4 may still be available and cheaper for short tasks where the large context is not needed.
Claude Sonnet 5 and OpenAI's GPT-4o are both multimodal models with strong reasoning, but they differ in context windows (Sonnet 5: 1M tokens; GPT-4o: 128K tokens) and output limits (Sonnet 5: 128K; GPT-4o: 16K). Sonnet 5 offers significantly larger capacity, making it better for tasks like processing entire codebases or lengthy books. GPT-4o has faster typical latency and broader integration with OpenAI's ecosystem (plugins, DALL-E, etc.). Pricing: GPT-4o costs $2.50/$10 per 1M tokens (input/output), similar to Sonnet 5. Both achieve high reasoning scores, but Sonnet 5's 81.2 OSWorld-Verified is not directly comparable to any GPT-4o benchmark. For OS-level automation, Sonnet 5 appears stronger. For creative writing or general chat, GPT-4o may be slightly more versatile due to its larger training data and tool usage. The choice depends on context needs; through OrcaRouter, you can switch between them easily.
Google's Gemini 1.5 Pro offers a 1M-token context (matching Sonnet 5) and multimodal capabilities, but Gemini's output is limited to 8K tokens, far less than Sonnet 5's 128K. Gemini's pricing is $3.50/$10.50 per 1M tokens (input/output), making Sonnet 5 slightly cheaper for input. Both score well on reasoning benchmarks, but Sonnet 5's OSWorld score of 81.2 is a key differentiator—Gemini's OS-level performance is not similarly highlighted. Gemini 1.5 Pro supports native code execution and can generate code with execution, while Sonnet 5 relies on external sandboxing. For pure text generation at scale, Sonnet 5's higher output limit is a clear advantage. Both models support file attachments and images. Long-context retrieval quality is competitive; minor differences may appear in specific domains. Via OrcaRouter, you can compare both models by simply changing the model ID.
OpenAI-compatible — keep the SDK you already use
https://api.orcarouter.ai/v1https://api.orcarouter.aifrom openai import OpenAI
client = OpenAI(
base_url="https://api.orcarouter.ai/v1",
api_key="$ORCAROUTER_API_KEY",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)include_reasoningmax_completion_tokensmax_tokensreasoningresponse_formatstopstructured_outputstool_choicetoolsverbosity| Input / 1M tokens | $2.00 |
| Output / 1M tokens | $10.00 |
| Cache read / 1M | $0.200 |
| Cache write / 1M | $2.50 |
| Currency | USD |
Estimate based on list price
Estimate only — actual token counts depend on the provider's tokenizer.
GET /api/public/models/anthropic/claude-sonnet-5Open @misc{orcarouter_claude_sonnet_5,
title = {Claude Sonnet 5 API},
author = {Anthropic},
year = {2026},
howpublished = {OrcaRouter},
url = {https://www.orcarouter.ai/models/anthropic/claude-sonnet-5}
}Anthropic. (2026). Claude Sonnet 5 API. OrcaRouter. https://www.orcarouter.ai/models/anthropic/claude-sonnet-5