Claude Opus 5 API: Pricing, Adaptive Thinking, and Usage Guide (Python + curl)
Released by Anthropic on July 24, 2026, Claude Opus 5 is the company's reasoning flagship: a 1M-token context window, 128K-token maximum output, and adaptive thinking enabled by default — launched at the same price point as Opus 4.8. This guide covers what Opus 5 brings, what adaptive thinking actually means, where the model sits next to Sonnet 5 and Fable 5 in the Claude 5 family, and how to make your first API call with Python and curl, streaming included. Every example runs against Onysoft AI Gateway's OpenAI-compatible endpoint, so if you already use the OpenAI SDK, switching is a two-line change.
What Claude Opus 5 Brings
The Claude 5 family opened on July 3, 2026 with Sonnet 5 (the balanced sibling) and Fable 5, the representative of the top-tier Mythos class; Opus 5 joined on July 24 as Anthropic's flagship, taking the deep-reasoning seat. The spec sheet is straightforward: a 1M-token input context and a 128K-token maximum output. That is enough to carry large codebases, long document sets, and multi-step agent histories in a single request — and the 128K output ceiling means long reports and extensive code generation can finish in one response.
The most talked-about change in this release is adaptive thinking, on by default: the model decides for itself how much to reason based on each request's difficulty. We break that down in its own section below.
On pricing, Anthropic made an aggressive call: Opus 5 launched at the same price point as Opus 4.8. At Onysoft pricing, anthropic/claude-opus-5 costs $7.50 per 1M input tokens and $37.50 per 1M output tokens. For latency-critical workloads there is also a Claude Opus 5 Fast variant: anthropic/claude-opus-5-fast, priced at $15 / $75 per 1M input/output tokens, delivering the same Opus-class quality on a speed-prioritized tier.
What Does Adaptive Thinking Mean?
With previous-generation reasoning models, the developer had to make a choice: fast mode with thinking off, or deep mode with a long thinking budget? Choosing wrong cost you either answer quality or unnecessary latency and spend. Adaptive thinking hands that choice to the model itself: Opus 5 assesses how hard each request is, answers simple questions almost immediately, and deepens its internal reasoning on its own when a problem calls for multi-step analysis.
In practice, that has three consequences:
- One model, two personalities: the same endpoint can carry both quick Q&A and deep-analysis traffic — a separate "cheap model for easy jobs" setup stops being mandatory.
- Cost scales with difficulty: because reasoning depth adjusts per task, you don't pay for unnecessary reasoning tokens on simple requests; a
max_tokenscap gives you an additional ceiling on the output side. - Less prompt engineering: instead of forcing a mode with "think step by step" style nudges, plainly describing the task is usually enough.
The default being adaptive also changes onboarding: there is no special configuration needed to try Opus 5 — set the model name, send the request, done.
Opus 5 vs Sonnet 5 vs Fable 5: Which Model for Which Job?
The Claude 5 family has three distinct characters, and the right pick depends on the workload:
- Sonnet 5 — the balanced workhorse: everyday production traffic, coding assistance, summarization, RAG, and agent subtasks. The bulk of your traffic most likely belongs here, at the family's best price/performance balance.
- Opus 5 — the reasoning flagship: deep analysis, multi-file refactors across complex codebases, legal and financial review over long document sets, hard math, and architecture decisions. The 1M context + 128K output + adaptive thinking trio exists exactly for this class.
- Fable 5 — the Mythos-class summit: the top tier, reserved for the hardest research and agent tasks where the margin for error is near zero; details in the Claude Fable 5 API guide.
A practical rule: start with Sonnet 5, escalate the cases where quality falls short to Opus 5, and reserve only the most critical steps for Fable 5. All three live in the Claude catalog behind the same sk-ony- key, with current prices side by side — and that same key reaches all 708+ models in the catalog, flagships from other providers included.
Getting Claude Opus 5 API Access, Step by Step
You don't need a separate Anthropic contract to use Opus 5 — Onysoft AI Gateway exposes it through a single OpenAI-compatible API, and setup takes about five minutes:
- Create a free account — pay-as-you-go, no subscription or monthly commitment.
- Generate an API key with the
sk-ony-prefix from the dashboard. - Add balance; usage is deducted as you go, and you can see per-request costs in the panel.
- Try
anthropic/claude-opus-5in the Playground before writing code — running the same prompt against Sonnet 5 side by side is the fastest way to see which jobs genuinely need the flagship. - Point your SDK's
base_urltohttps://api.onysoft.com/v1, set the model name, and ship.
If you already have an OpenAI integration, migration is a two-line change: base_url and model. The same key unlocks the rest of the catalog too — one balance, one invoice, one API. Teams in Türkiye additionally get local-currency billing at the central bank (TCMB) rate, compliant corporate e-invoicing, KVKK compliance, and 24/7 support out of the box; the broader local picture is covered in our Claude API in Türkiye guide.
First Request with Python, curl, and Streaming
Because the Onysoft endpoint follows the OpenAI schema exactly, the official openai Python package works as-is:
from openai import OpenAI
client = OpenAI(
base_url="https://api.onysoft.com/v1",
api_key="sk-ony-YOUR_KEY",
)
response = client.chat.completions.create(
model="anthropic/claude-opus-5",
messages=[
{"role": "user", "content": "Analyze the risky clauses in this contract draft and list them with reasoning."}
],
)
print(response.choices[0].message.content)The same request with curl:
curl https://api.onysoft.com/v1/chat/completions \
-H "Authorization: Bearer sk-ony-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-5",
"messages": [{"role": "user", "content": "Analyze the trade-offs of this architecture decision in depth."}]
}'For long analyses, don't wait for the full response — stream it. In Python, just pass stream=True:
stream = client.chat.completions.create(
model="anthropic/claude-opus-5",
messages=[{"role": "user", "content": "Produce a comprehensive refactoring plan for this codebase."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="")Over raw HTTP, the equivalent is adding "stream": true to the request body. If latency is critical, switch the model name to anthropic/claude-opus-5-fast — the schema stays identical.
⚡ OnyRouter tip: if you'd rather automate model selection, use onysoft/auto — OnyRouter automatically routes deep-analysis requests to the reasoning flagship. Function calling (tools) and JSON mode use the same schema as well; full parameter references and error codes are in the API documentation.
Frequently Asked Questions
How do I get Claude Opus 5 API access?
Sign up for Onysoft AI Gateway, generate an sk-ony- prefixed API key from the dashboard, and add balance. Then point any OpenAI-compatible SDK at https://api.onysoft.com/v1 and set the model to anthropic/claude-opus-5. There is no separate Anthropic contract, waitlist, or subscription — it's pay-as-you-go from the first request.
What does the Claude Opus 5 API cost?
On Onysoft, anthropic/claude-opus-5 is priced at $7.50 per 1M input tokens and $37.50 per 1M output tokens — Opus 5 launched at the same price point as Opus 4.8. The speed-prioritized Claude Opus 5 Fast variant (anthropic/claude-opus-5-fast) is priced at $15 per 1M input and $75 per 1M output tokens.
What is adaptive thinking in Claude Opus 5?
Adaptive thinking, enabled by default in Opus 5, means the model adjusts its internal reasoning depth to each request on its own: simple questions get near-instant answers, while problems requiring multi-step analysis trigger deeper reasoning automatically. You no longer choose between a fast mode and a deep mode by hand, and you don't pay unnecessary reasoning cost on easy requests.
What is the difference between Opus 5, Sonnet 5, and Fable 5?
All three are members of the Claude 5 family released in 2026: Sonnet 5 is the balanced workhorse for everyday production traffic, Opus 5 is the reasoning flagship for deep analysis and complex tasks, and Fable 5 represents the top-tier Mythos class. A practical approach is to start with Sonnet 5, escalate quality-critical cases to Opus 5, and reserve only the hardest steps for Fable 5 — the same sk-ony- key reaches all three.
What are Claude Opus 5's context window and maximum output?
The input context is 1M tokens with a 128K-token maximum output. That comfortably covers large codebases, long document sets, and multi-step agent histories in a single request, while the 128K output ceiling lets long reports and extensive code generation finish in one response. A max_tokens cap gives you an extra cost control on the output side.
Related pages
Ready to build?
Access 708+ AI models through a single API. Pay as you go — no subscription.