Claude Sonnet 5

claude-sonnet-5

Sonnet 5 is Anthropic's most capable Sonnet-class model, delivering frontier-level performance across coding, agentic workflows, and professional knowledge tasks. It supports text, image, and file inputs, features a 1M-token context window, and offers adaptive thinking with configurable reasoning levels (low, medium, high, max, and x-high) to balance speed, cost, and reasoning depth. Optimized for complex coding, long-horizon agent execution, and professional workflows, Sonnet 5 combines strong reasoning, robust instruction following, and enhanced safety features, including an updated tokenizer and real-time cyber safeguards for high-risk dual-use scenarios.

Context
1M tokens
Endpoint
Get API KeyCompare

Pricing

Input$2.00 / 1M
Output$10.00 / 1M
Cache Write$2.50 / 1M
Cache Read$0.20 / 1M
Web Search$0 / 1M

Quick Start

Select an endpoint and copy a working example for this model.

Endpoint:
python
from openai import OpenAI client = OpenAI(    api_key="YOUR_API_KEY",    base_url="https://api.apertis.ai/v1") response = client.chat.completions.create(    model="claude-sonnet-5",    messages=[        {"role": "user", "content": "Hello!"}    ],    max_tokens=1024,    temperature=0.7) print(response.choices[0].message.content) # Optional: Enable context compression to reduce token usage# response = client.chat.completions.create(#     model="claude-sonnet-5",#     messages=[{"role": "user", "content": "Hello!"}],#     extra_body={"compression": {"enabled": True, "model": "gpt-4.1-mini"}}# )

Supported Parameters

API docs
Common7 params
modelmessagesmax_tokenstemperaturetop_pstreamtools
Extended4 params
reasoning_effortstream_optionsthinkingextra_body

Cursor IDE Model IDs

Use these namespaced identifiers in Cursor IDE to avoid conflicts with built-in models.

claude-sonnet-5

Compare with Other Models

See how this model compares to others from the same provider.

Claude Opus 4.8 (Fast)

This is the fast version of Opus 4.8

Context
1M
Input
$10.00/M
Output
$50.00/M

Claude Opus 4.8

Claude Opus 4.8 is Anthropic's most capable generally available model in the Opus family, designed for highly autonomous agents, long-horizon workflows, and advanced knowledge work. It supports text, image, and file inputs with text output, includes reasoning capabilities, and features a 1M-token context window for maintaining coherence across extended tasks and sessions. The model excels at multi-step reasoning, complex coding, and end-to-end project orchestration, including large codebases, multi-stage debugging, and long-running asynchronous agent pipelines. Beyond software engineering, it is highly effective for document drafting, presentation creation, data analysis, and memory-driven workflows, delivering consistent quality across very long outputs and complex projects.

Context
1M
Input
$4.00/M
Output
$20.00/M

Claude Opus 4.7 (Fast)

This is the fast version of Opus 4.7

Context
1M
Input
$30.00/M
Output
$150.00/M

Claude Opus 4.7

Opus 4.7 is the next generation of Anthropic's Opus family, designed for long-running, asynchronous agent workflows. Building on Opus 4.6, it delivers stronger performance on complex, multi-step tasks and more reliable execution across extended pipelines such as large codebases, multi-stage debugging, and end-to-end project orchestration. Beyond coding, Opus 4.7 enhances knowledge work capabilities, including document drafting, presentation creation, and data analysis. With strong coherence over long outputs and sessions, it is well suited for tasks requiring persistence, judgment, and sustained execution.

Context
1M
Input
$4.00/M
Output
$20.00/M