← Back to Blog

Claude Opus 5 API Guide 2026: Pricing, 1M Context & Adaptive Thinking

(Unofficial)

This guide is independently community-maintained. It is not affiliated with, endorsed by, or sponsored by the vendor of the third-party tool it covers. All third-party trademarks are the property of their respective owners.

July 27, 2026

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)

$5.25 / MTok

$26.25 / MTok

$6.56 / MTok

$0.53 / MTok

CodeGateway (Tier 1)

$6.25 / MTok

$31.25 / MTok

$7.81 / MTok

$0.63 / MTok

CodeGateway bills every account at the same flat 1.07× markup: no tiers, no downgrades, regardless of 90-day spend or top-up size. 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

python
import anthropic

client = anthropic.Anthropic(
api_key="cg-your-key-here",
base_url="https://api.codegateway.dev",
)

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)

python
from openai import OpenAI

client = OpenAI(
base_url="https://api.codegateway.dev/v1",
api_key="cg-your-key-here"
)

response = client.chat.completions.create(
# Claude models use the Anthropic protocol (/v1/messages) and are not served here;
# this snippet demos the OpenAI-compatible surface with GPT-5.5
model="gpt-5.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

bash
curl https://api.codegateway.dev/v1/messages \
-H "Authorization: Bearer cg-your-key-here" \
-H "anthropic-version: 2023-06-01" \
-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

  1. `thinking` parameter removed — Opus 5 uses adaptive thinking by default. Remove any thinking={"type": "enabled", "budget_tokens": N} from your requests.

  2. Max output increased to 128K — if you had workarounds for the 64K output limit, they can be simplified.

  3. System prompt caching — Opus 5 automatically caches system prompts >1024 tokens. No cache_control breakpoints needed for the system message.

  • 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 thinking parameter 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: No. Claude models speak the Anthropic Messages protocol, so Opus 5 is served at POST https://api.codegateway.dev/v1/messages, not at the OpenAI-compatible /v1/chat/completions or /v1/responses endpoints, which reject Claude-family models. Point the OpenAI SDK at an OpenAI model, or call Opus 5 with the Anthropic SDK or cURL.

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 free credit after binding a card (current amount on the signup/pricing page), create an API key, and use claude-opus-5 as the model ID. Binding a payment method in the dashboard unlocks the starter credit.

Author:CodeGateway Team

Solve API Key & Billing limits with CodeGateway

Lacking an official API key or facing overseas card payment issues? Create an sk-cg- key instantly. One key for Claude, GPT, Gemini, and DeepSeek: Claude and Gemini text models use the Anthropic Messages protocol (/v1/messages) — the OpenAI-compatible text endpoints do not accept them. Built-in smart routing and free trial credits included.

Sign up free