Claude Opus 5 API Guide 2026: Pricing, 1M Context & Adaptive Thinking
Claude Opus 5 launched on July 26, 2026 with a headline upgrade: a 1 million token context window — 5× the 200K limit of Opus 4.8 — at the same $5 / $25 per MTok price point. This guide covers pricing, benchmarks, API access, and migration from Opus 4.8.
What's New in Claude Opus 5
Feature | Opus 4.8 | Opus 5 |
|---|---|---|
Context window | 200K tokens | 1M tokens |
Reasoning | Extended thinking | Adaptive thinking |
Input price | $5 / MTok | $5 / MTok |
Output price | $25 / MTok | $25 / MTok |
Cache read | $0.50 / MTok | $0.50 / MTok |
Long-context surcharge | N/A | None |
Max output | 64K tokens | 128K tokens |
1M Context Window
Opus 5 processes up to 1 million tokens in a single request — enough for an entire codebase, a 2,000-page PDF, or a full year of support tickets. Unlike Gemini 3.1 Pro which applies a 2× input multiplier above 200K tokens, Opus 5 charges the same rate regardless of context length.
Adaptive Thinking
Opus 5 replaces the binary "extended thinking on/off" toggle with adaptive thinking: the model dynamically allocates reasoning depth per token, spending more compute on hard sub-problems and less on trivial ones. In practice this means:
Lower latency on simple queries (no wasted thinking budget)
Better accuracy on multi-step code generation (deeper reasoning where it matters)
No need to set
thinking.budget_tokens— the model self-regulates
Claude Opus 5 Pricing
Tier | Input | Output | Cache Write | Cache Read |
|---|---|---|---|---|
Anthropic direct | $5 / MTok | $25 / MTok | $6.25 / MTok | $0.50 / MTok |
CodeGateway (Tier 5) | $6.00 / MTok | $30.00 / MTok | $7.50 / MTok | $0.60 / MTok |
CodeGateway (Tier 1) | $7.50 / MTok | $37.50 / MTok | $9.38 / MTok | $0.75 / MTok |
CodeGateway markup ranges from 1.2× (Tier 5, ≥$500/90d spend) to 1.5× (Tier 1). No monthly fee, no minimum spend, balance never expires.
Cost Comparison: Opus 5 vs Competitors (1M context task)
Processing a 500K-token codebase review:
Model | Input cost | Output cost (est. 10K) | Total |
|---|---|---|---|
Claude Opus 5 | $2.50 | $0.25 | $2.75 |
Gemini 3.1 Pro (>200K surcharge) | $3.00 | $0.12 | $3.12 |
GPT-5.5 Pro | $15.00 | $1.80 | $16.80 |
Opus 5 wins on large-context tasks because it has no long-context surcharge.
How to Access Opus 5 via API
Anthropic SDK
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5",
max_tokens=4096,
messages=[{"role": "user", "content": "Review this codebase for security issues..."}]
)OpenAI-Compatible Endpoint (CodeGateway)
from openai import OpenAI
client = OpenAI(
base_url="https://api.codegateway.dev/v1",
api_key="cg-your-key-here"
)
response = client.chat.completions.create(
model="claude-opus-5",
messages=[{"role": "user", "content": "Review this codebase for security issues..."}],
max_tokens=4096
)One API key gives you Claude Opus 5, GPT-5.5, Gemini 3.1 Pro, and 50+ other models behind the same OpenAI-compatible interface.
cURL
curl https://api.codegateway.dev/v1/chat/completions \
-H "Authorization: Bearer cg-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5",
"messages": [{"role": "user", "content": "Summarize this 800-page contract..."}],
"max_tokens": 4096
}'Migration Guide: Opus 4.8 → Opus 5
Breaking Changes
`thinking` parameter removed — Opus 5 uses adaptive thinking by default. Remove any
thinking={"type": "enabled", "budget_tokens": N}from your requests.Max output increased to 128K — if you had workarounds for the 64K output limit, they can be simplified.
System prompt caching — Opus 5 automatically caches system prompts >1024 tokens. No
cache_controlbreakpoints needed for the system message.
Recommended Prompt Adjustments
Remove explicit "think step by step" instructions — adaptive thinking handles this natively
For code generation: you can now pass the entire repository context instead of chunking
For document Q&A: no more RAG pipeline needed for documents under ~750K tokens
Migration Checklist
[ ] Update model string:
claude-opus-4-8→claude-opus-5[ ] Remove
thinkingparameter from API calls[ ] Remove manual context chunking for documents <1M tokens
[ ] Test with production prompts — adaptive thinking may change output style
[ ] Update rate limit expectations (Opus 5 has higher TPM limits)
When to Use Opus 5 vs Sonnet 4.6
Use Case | Recommended Model | Why |
|---|---|---|
Large codebase review (>200K tokens) | Opus 5 | 1M context, no chunking needed |
Simple chat / Q&A | Sonnet 4.6 | 5× cheaper, faster latency |
Complex multi-step reasoning | Opus 5 | Adaptive thinking excels |
High-volume production API | Sonnet 4.6 | Cost-efficient at scale |
Legal / contract analysis | Opus 5 | Full document in context |
Code completion / autocomplete | Sonnet 4.6 | Speed matters more than depth |
FAQ
Q: Is Claude Opus 5 available on CodeGateway? A: Yes. Opus 5 is live on CodeGateway as of July 26, 2026. Use model ID claude-opus-5 with any existing API key.
Q: Does Opus 5 cost more than Opus 4.8? A: No. Same base pricing ($5/$25 per MTok). The 1M context and adaptive thinking come at no price premium.
Q: What is adaptive thinking? A: Instead of a fixed thinking budget, Opus 5 dynamically allocates reasoning compute per token. Simple questions get fast answers; complex problems get deeper analysis — automatically.
Q: Can I use Opus 5 with the OpenAI SDK? A: Yes. CodeGateway provides an OpenAI-compatible endpoint. Just set model="claude-opus-5" and base_url="https://api.codegateway.dev/v1".
Q: Is there a long-context surcharge for Opus 5? A: No. Unlike Gemini 3.1 Pro (2× above 200K) or GPT-5.5 Pro (undisclosed threshold), Opus 5 charges the same per-token rate at any context length up to 1M.
Q: How do I get started with Opus 5 on CodeGateway? A: Sign up at dashboard.codegateway.dev, get $2 free credit, create an API key, and use claude-opus-5 as the model ID. No credit card required to start.