How to Choose Anthropic’s Current Claude Models: Fable, Opus, Sonnet, and Haiku Compared

A comparison of Anthropic’s current Claude Fable 5, Opus 4.8, Sonnet 5, Haiku 4.5, and Mythos 5 by positioning, price, context, latency, and use case.

Anthropic’s current Claude lineup is no longer as simple as “Haiku is fast, Sonnet is balanced, Opus is strongest.” As of July 2026, the main models include Claude Fable 5, Claude Opus 4.8, Claude Sonnet 5, Claude Haiku 4.5, and the limited-availability Claude Mythos 5.

If you want a quick rule: start with Sonnet 5 for daily development and most Agent tasks; use Opus 4.8 for complex enterprise Agents and hard coding; consider Fable 5 when you need the highest capability; use Haiku 4.5 for low-latency, cost-sensitive work; do not treat Mythos 5 as a general-purpose option because it is only available to approved customers.

Current main models

Model API ID / alias Positioning Context Max output Latency tendency Standard price
Claude Fable 5 claude-fable-5 Highest capability among broadly released Anthropic models, suited to long-running Agents 1M tokens 128k tokens Slower $10 / MTok input, $50 / MTok output
Claude Opus 4.8 claude-opus-4-8 Complex Agent coding, enterprise workflows, browser/computer use 1M tokens 128k tokens Medium $5 / MTok input, $25 / MTok output
Claude Sonnet 5 claude-sonnet-5 Best balance of speed, capability, and price; a strong default 1M tokens 128k tokens Fast $2 / $10 before 2026-08-31; then $3 / $15
Claude Haiku 4.5 claude-haiku-4-5 Fastest and lowest-cost model for high-throughput light tasks 200k tokens 64k tokens Fastest $1 / MTok input, $5 / MTok output
Claude Mythos 5 claude-mythos-5 Same specs and price as Fable 5, but limited availability 1M tokens 128k tokens Slower $10 / MTok input, $50 / MTok output

MTok means million tokens. Pricing may also be affected by prompt caching, batch processing, data residency, cloud platform, and region, so the table only includes common base input/output prices.

Fable 5: highest capability, but not the default

Claude Fable 5 is the highest-capability broadly released model in Anthropic’s current lineup. Its official positioning is “next-generation intelligence for long-running agents.”

It fits:

  • Long-running, multi-step Agent workflows.
  • Complex research, code migration, and cross-system planning.
  • Enterprise tasks that need the strongest reasoning and large context.
  • High-value tasks that are less sensitive to cost and latency.

But Fable 5 is not necessarily the default. It is the most expensive and slower. Unless the task truly needs the highest ceiling, starting with Sonnet 5 or Opus 4.8 is usually more practical.

One more detail: Fable 5 uses adaptive thinking and it is always on. It decides when and how much to reason automatically. That helps complex tasks, but it also makes cost and response time more dependent on the task itself.

Opus 4.8: a solid choice for complex coding and enterprise Agents

Claude Opus 4.8 sits between Fable 5 and Sonnet 5. Anthropic suggests starting with Opus 4.8 when you are unsure which model to use for complex Agent coding and enterprise work.

Its strengths include:

  • 1M token context.
  • 128k token max output.
  • Strong performance on complex coding, browser Agents, computer use, and enterprise workflows.
  • Half the price of Fable 5.
  • Support for adaptive thinking.

Opus 4.8 is well suited as the “hard-task default.” Codebase-level refactors, complex PR fixes, enterprise data analysis, multi-tool Agents, and long-document reasoning can all start here.

If a task is extremely hard, upgrade from Opus 4.8 to Fable 5. If task volume is high and cost pressure is obvious, move down to Sonnet 5.

Key points in this update

Claude Opus 4.8 is now available, with pricing unchanged. Anthropic also highlighted several accompanying changes:

  • Opus 4.8 continues to improve over the previous generation in coding, agent capabilities, reasoning, and knowledge work evaluations.
  • claude.ai users can control how much effort Claude spends on a task.
  • Claude Code adds dynamic workflows for handling larger-scale problems.
  • Opus 4.8’s fast mode can work at roughly 2.5x speed and is three times cheaper than the previous model’s fast mode.

Taken together, these changes show that Anthropic is not merely making a small model-score upgrade. It is reshaping the product around “running complex tasks for a long time.” A stronger model is only one part of that; task control, workflow decomposition, and cost structure matter just as much.

Why Claude Code users should pay closer attention

For a coding agent like Claude Code, the biggest risk is not failing to write a single function, but getting lost inside a real repository. It needs to read files, understand dependencies, run tests, inspect errors, revise its plan, and keep changes within a reasonable scope.

Opus 4.8’s selling points line up closely with these problems:

  1. It is better suited to agentic tasks, meaning tasks where the model must keep planning, call tools, observe results, and adjust strategy.
  2. It puts more emphasis on judgement, so it can stop and confirm when uncertain instead of confidently writing the wrong thing all the way through.
  3. Dynamic workflows make Claude Code better suited to large, multi-step problems.

If these abilities prove stable in real projects, Claude Code will feel closer to “give it a clear goal and let it push forward” instead of only asking it to fill in a piece of code.

What effort control means

Anthropic added effort control to claude.ai this time, and the meaning is straightforward: users can adjust how much energy the model spends on a task.

That is very practical for everyday use. Simple questions do not need deep reasoning, while complex tasks are worth giving the model more time to think. In the past, many users could only express “be more careful” or “answer quickly” through prompts. Now this kind of control is starting to appear in the product layer.

For developers, this is also a signal: future agent products will not expose only “which model to choose.” They will also expose more execution strategies, such as speed, cost, reasoning depth, tool-call aggressiveness, and risk preference.

The cost change in fast mode matters

Anthropic says Opus 4.8’s fast mode can reach roughly 2.5x speed, while costing much less than the previous model’s fast mode.

This point is easy to miss under the model-capability headlines, but it matters a lot for real workflows. Many agent tasks do not run just once; they repeat:

  • Generate an initial draft
  • Run tests
  • Fix failures
  • Run tests again
  • Continue revising based on review

If fast mode is cheap enough, teams will be more willing to put it into high-frequency workflows instead of using the top model only occasionally for critical tasks. Once speed and cost come down, agents can more easily move from “demo effect” to “everyday tool.”

Its relationship to Opus 4.7

Opus 4.8 feels more like a usability-focused enhancement. It inherits Opus 4.7’s positioning, but pushes further into coding, agent tasks, and professional work.

Based on Anthropic’s wording, Opus 4.8 is not just better at answering. It is better at collaborating. During a task, it should be clearer about when it needs information, when a plan is shaky, and when it should build confidence before making large changes.

These capabilities are hard to judge from a single benchmark. The real test is how it performs in large repositories, complex business rules, long-context tasks, and multi-round fixes.

Impact on AI coding competition

In 2026, model competition has clearly shifted from “chat ability” to “can it get work done.” OpenAI, Anthropic, Google, and xAI are all binding models more tightly to toolchains: models handle reasoning, tools handle execution, and the product layer keeps tasks within a controllable range.

The release of Claude Opus 4.8 continues this trend. Its focus is not showing off one isolated capability, but strengthening three links:

  • The model itself is better suited to code and agent tasks.
  • Claude Code can break down larger workflows.
  • The product layer is starting to offer execution controls such as effort and fast mode.

For developers, the practical meaning is that choosing a model cannot be only about “which one is smartest.” You also need to ask whether it fits the tool you use, whether it can call tools reliably, whether the cost of long tasks is acceptable, and whether it is easy to correct when it fails.

Sonnet 5: the best daily default

Claude Sonnet 5 is the most important default candidate today. Its positioning is the best combination of speed and intelligence.

It fits:

  • Daily coding and code review.
  • Documentation, research assistance, and knowledge work.
  • Medium-complexity Agents.
  • Internal enterprise automation.
  • API applications that need cost control without losing too much quality.

The biggest change in Sonnet 5 is that many Agent capabilities that used to feel closer to Opus have moved into the Sonnet price tier. It also supports 1M token context and 128k token output, with lower latency than Opus.

Pricing has an introductory discount until August 31, 2026: $2 / MTok input and $10 / MTok output. From September 1, 2026, it returns to $3 / MTok input and $15 / MTok output. Even at the standard price, it remains significantly cheaper than Opus 4.8.

For most teams, I would start with Sonnet 5: let it cover 70% to 80% of tasks, then escalate truly difficult work to Opus 4.8 or Fable 5.

Availability and pricing

Claude Sonnet 5 is available across Claude plans:

  • Free and Pro users use Sonnet 5 by default.
  • Max, Team, and Enterprise users can use Sonnet 5.
  • Claude Code and Claude Platform support Sonnet 5.
  • Developers can use the model name claude-sonnet-5 in the Claude API.

The API price uses a lower introductory period before moving to the standard rate:

Time Input price Output price
Before August 31, 2026 $2 / million tokens $10 / million tokens
Standard price afterward $3 / million tokens $15 / million tokens

Anthropic also says Sonnet 5 uses an updated tokenizer. The same input may map to more tokens under the new tokenizer, roughly 1.0 to 1.35 times the old count depending on content type. One purpose of the introductory price is to make the migration from Sonnet 4.6 smoother.

Key improvement: Sonnet becomes a practical execution layer

The keyword for Sonnet 5 is agent. Anthropic emphasizes that it can plan, use tools such as browsers and terminals, and keep working through longer task chains.

For developers and enterprise users, that matters in several ways:

  1. Coding tasks can move beyond snippet completion toward multi-step changes, debugging, and validation.
  2. Tool use is more stable, making it more suitable for browsers, terminals, enterprise apps, and internal workflows.
  3. At medium effort, Sonnet 5 offers better cost-performance; at higher effort, some tasks can approach Opus 4.8.
  4. For Claude Code users, it feels more like a daily execution model than an expensive option reserved for a few hard tasks.

Anthropic cites early partner feedback from complex codebases, brownfield projects, insurance workflows, legal research, and data analysis. The recurring theme is that Sonnet 5 can follow tasks more completely instead of stopping midway or only giving advice.

Safety assessment: safer, but not risk-free

Anthropic’s safety assessment has two sides.

On one hand, Sonnet 5 is steadier than Sonnet 4.6. It improves agent safety, refusal of malicious requests, prompt-injection resistance, hallucination reduction, and lower sycophancy. Anthropic’s automated behavior audits also show a lower rate of undesirable behavior than Sonnet 4.6.

On the other hand, it is not as steady as stronger models such as Opus 4.8 or Mythos Preview. In the same safety evaluation category, Sonnet 5 still has a higher undesirable-behavior rate than those models.

For cybersecurity, Anthropic says it did not intentionally train Sonnet 5 on cybersecurity tasks. It can handle some ordinary, benign security work, but in potentially dangerous capability evaluations it is clearly weaker than Opus 4.8 and Mythos 5. In the Firefox exploit evaluation mentioned by Anthropic, Sonnet 5 did not produce a complete usable exploit, though it had a higher partial success rate than Sonnet 4.6.

Because of that, Sonnet 5 has cybersecurity safeguards enabled by default. These safeguards detect and block dangerous cybersecurity uses in real time. Their strength is similar to Claude Opus 4.7 and Opus 4.8, but lower than the stricter safeguards used on Fable 5.

What to watch when migrating

If you already use the Claude API or Claude Code, Sonnet 5 is a direct upgrade candidate for Sonnet 4.6, but there are three details worth checking first.

First, change the model name to:

1
claude-sonnet-5

Second, do not estimate cost from unit price alone. Sonnet 5’s standard price is higher than the launch discount, and the tokenizer change may increase token usage for some inputs. For long-context tasks, log analysis, and codebase scans, re-estimate costs with your own real requests.

Third, effort settings affect cost-performance. Sonnet 5 can cover a wider range of cost and capability at different effort levels. Daily coding, documentation, and lightweight agent tasks may not need the highest effort. Save higher effort for tasks that truly require long planning and multi-tool collaboration.

Its relationship with Opus 4.8

Sonnet 5 does not replace Opus 4.8. A better way to understand it is that part of the agent capability that used to feel closer to Opus has moved down into the Sonnet tier.

For tasks that need the highest ceiling, especially complex research, deep reasoning, long-chain agents, and difficult coding, Opus 4.8 still has a place. For daily throughput, price, and stable execution, Sonnet 5 is better suited as the default model.

That is the most important signal in this release. Sonnet is no longer just the “fast and affordable” middle tier. It is starting to take on a large amount of real execution work. For enterprises and developers, model selection may shift from “default to Opus and downgrade if too expensive” to “default to Sonnet 5 and upgrade to Opus when needed.”

Practical migration guide: test by task tier

If your team already uses Sonnet 4.6, do not switch every call to Sonnet 5 on day one. A steadier approach is to divide tasks by difficulty and risk: lightweight Q&A, summarization, code explanation, single-file edits, multi-file refactors, long-running agents, and automation with tool use. Prepare samples for each group.

In the first round, measure completion rate and rework rate, not just whether the answer feels smarter. In Claude Code, for example, compare whether it misses fewer tests, understands repository structure more reliably, and asks questions when uncertain.

In the second round, measure cost. The tokenizer change can make the same prompt produce more tokens, so use real logs instead of mental math from published prices. Long-context, document-analysis, and codebase tasks are especially sensitive to token changes.

Only then decide the default model. My suggestion is to make Sonnet 5 the first candidate for daily agent and coding tasks, keep Opus or Fable for retries and high-value tasks, and keep Haiku for lightweight batch work. That makes migration smoother and helps identify where the improvement is real.

Metrics to track

When testing Sonnet 5, record four metrics: first-pass task completion rate, manual editing time, tool-call failure rate, and cost per task. Benchmarks alone are easy to misread because real team tasks mix code, documents, environments, permissions, and context memory.

If Sonnet 5 is more stable than the older model for a task class, migrate that class first. If it only answers more verbosely while making bolder edits, keep human approval or use more conservative prompts.

Original: Introducing Claude Sonnet 5

Haiku 4.5: high throughput, low latency, low cost

Claude Haiku 4.5 is the fastest model in the current main Claude line. Anthropic positions it as the fastest model with near-frontier intelligence.

It fits:

  • Classification, extraction, summarization, and format conversion.
  • Batch processing of short text.
  • Customer support, tickets, moderation, and other high-throughput scenarios.
  • Latency-sensitive interactive products.
  • Light tasks that do not need 1M context.

Its limits are clear: 200k token context and 64k token max output, below the 1M / 128k of Fable, Opus, and Sonnet. It should not be the first choice for long codebases, complex multi-document analysis, or long-running Agents.

But for large volumes of simple, fast tasks, Haiku 4.5 is straightforwardly cost-effective: $1 / MTok input and $5 / MTok output.

Mythos 5: not a normal option

Claude Mythos 5 shares the same specs and price as Fable 5, but it is not generally available. Anthropic documentation marks it as limited availability, only for approved Project Glasswing customers.

In other words, for ordinary API model selection, you usually do not need to include Mythos 5. Unless you are already approved or obtain access through Anthropic, AWS, or Google Cloud account teams, it is not a direct replacement for Fable 5.

Migrating from Claude Opus 4.8 to Opus 5

Don’t just replace the model string and put it all online immediately. A more robust migration process is as follows.

Step 1: Freeze a real-world test set

Select 30 to 100 masked tasks from the production log, covering:

  • Normal success cases;
  • Cases that once needed to be retried;
  • Tool call failure cases;
  • Long context and high output tasks;
  • Legitimate tasks that may trigger security classifiers.

The test set should retain expected results or manual scoring standards, otherwise we can only compare writing styles but not task success rates.

Step 2: Modify only the model ID

First keep the prompt word, tool definition, maximum output length and timeout unchanged, and switch the model to:

1
claude-opus-5

This separates model changes from other configuration changes. If the prompt word and tool schema are rewritten at the same time, it will be difficult to locate the cause when regression occurs.

Step 3: Compare four groups of metrics

At least compare:

  1. Final mission success rate;
  2. Input, output and total token;
  3. P50, P95 end-to-end delay;
  4. Actual cost per successful mission.

Agent tasks should also separately record the number of tool calls, the number of invalid cycles, and the manual takeover rate.

Step 4: Recalibrate your prompts

Opus 5 is more proactive, and the large number of repeated instructions of “please continue checking” and “please verify yourself” in the old prompt words may no longer be necessary. Redundancy requirements can be phased out, but business boundaries must be preserved, for example:

  • No deployment without approval;
  • Production data must not be deleted;
  • Export evidence before modification;
  • Keys and personal information are not allowed to enter the log;
  • High-risk operations must wait for manual confirmation.

Increased initiative does not mean expanded scope of authority.

Step 5: Roll out gradually and keep a rollback path

First cut a small amount of traffic to Opus 5, and then gradually expand. Fallback conditions can include:

  • The error rate exceeds the threshold;
  • P95 latency significantly worsened;
  • The cost of a single task exceeds the budget;
  • Repeated loops occur in tool calls;
  • The security classifier fallback ratio increased abnormally.

The rollback strategy itself must also be tested, and you cannot wait for the production request to be triggered before confirming whether the log and response formats are compatible.

Two API Beta updates

Anthropic also introduced two API beta capabilities that work with Opus 5.

Change tools mid-conversation

Apps can change available tools in the middle of a conversation without invalidating the prompt cache. This is useful for long-running agents: the system can load databases, browsers, or deployment tools by task phase, without having to cram all the tool definitions into the context from the beginning.

Potential benefits include:

  • Reduce the interference of irrelevant tools on model selection;
  • Keep prompt cache to reduce the cost of repeated context;
  • Dynamically open tools based on permissions and task status;
  • Narrow the exposure window for high-risk tools.

Automatic model fallback after a classifier is triggered

The API can automatically switch to another model after a security classifier flags the request. The default settings select the best alternative model currently available, and fallback strategies can also be configured based on business needs.

When accessing this feature, the “actual response model” should be incorporated into observability. Otherwise the application sees the request succeed but has no idea why there are differences in output style, latency or capabilities for the same test set.

How will security mechanisms affect developers?

Anthropic said Opus 5 had an overall misconduct score of 2.3 in automated alignment audits, the lowest among recent models. At the same time, officials believe it is not pushing the forefront of high-risk dual-use capabilities, lagging behind Mythos 5 in biological and offensive cybersecurity.

The boundaries of cybersecurity scenarios are particularly noteworthy:

  • Source code vulnerability discovery can be allowed;
  • Binary vulnerability scanning, penetration testing and exploit generation may be blocked;
  • Opus 5’s vulnerability discovery capabilities have improved, but vulnerability exploitation development is still significantly behind Mythos 5;
  • The new classifier is expected to require approximately 85% less intervention than Fable 5.

In Claude.ai, Claude Code, and Cowork, flagged requests fall back to Opus 4.8 by default. API users can also enable fallback. Users in the Claude Verified Participants program can access capabilities with fewer restrictions.

The most important thing for the average development team is not to try to bypass classifiers, but to distinguish legitimate defensive tasks and provide clear user prompts and manual processing paths for blocked or rolled back requests.

How to choose Claude Pro, Max, Claude Code and API?

How to use Who it’s for Where Opus 5 is located
Claude Pro Personal daily research, writing and development Officially called the strongest model in Pro
Claude Max High-frequency professional user Opus 5 is already the default model
Claude Code In-terminal coding and agent tasks Can be used directly in programming workflows, Fast Mode is available through usage credits
Claude API Product integration, batch processing and self-built agents Using claude-opus-5, you can control traffic, budget and fallback by yourself

If you are just evaluating output quality, you can first create a test case in the Claude application; if you want to measure tokens, tool calls, error rates, and costs, you should use an API or an existing engineering evaluation framework.

Pre-launch checklist

  • The model ID has been changed to claude-opus-5, and other environments have not been changed by mistake;
  • API Key is provided through environment variables or key management services;
  • Build a regression test set using real, desensitized production tasks;
  • Record input and output tokens, delays, tool calls and success rates;
  • Compare costs by “per successful task” instead of just unit price;
  • Fast Mode has independent budget and monitoring;
  • effort starts with low or medium settings and escalates by failure conditions;
  • High-risk tools are still controlled by permissions and manual confirmation;
  • Automatic model rollback is visible in the log;
  • Preserve Opus 4.8 fallback path during grayscale release.

Opus 5: API, Fast Mode, and migration

Where Claude Opus 5 fits

Anthropic describes the Opus 5 as a more “thoughtful and proactive” model in the release notes. The initiative here is not about performing dangerous actions without permission, but when faced with an open task, being able to complete the necessary steps, create test tools and check your own results.

Several official cases illustrate this change:

  • Completing the computer vision pipeline in FreeCAD instead of just generating an isolated piece of code;
  • Locate the root cause of a package manager problem instead of just reporting an error on the surface;
  • Build trading market data sources and create your own test tools to verify behavior.

Such tasks have one thing in common: the goals given by the user are often incomplete, and the model must maintain state between multiple steps and determine when validation is needed. For Claude Code, internal R&D agents and desktop automation, this is more valuable than a single Q&A score.

How does it compare with Opus 4.8, Fable 5, Mythos 5?

According to Anthropic’s official positioning, it can be understood as follows:

Models Better Positioning Key Information in Official Comparisons
Claude Opus 4.8 Existing Opus workloads that are already running stably Opus 5 maintains the same base unit price and improves on multiple capabilities
Claude Opus 5 Highly difficult general agent, programming, scientific research and tool operation Close to the cutting-edge intelligence of Fable 5 at about half the price
Claude Fable 5 Missions pursuing the highest ability ceiling Still maintaining a small lead in CursorBench 3.2, but mission costs are higher
Claude Mythos 5 More cutting-edge network security capabilities Officials have made it clear that Opus 5 lags behind Mythos 5 in terms of network security

This chart is not a substitute for your own testing. In particular, conclusions such as “close” and “leading” rely on specific benchmarks, effort levels, and tool environments, and cannot be directly equated to the effects in all business scenarios.

What performance improvements have been officially announced?

Anthropic publishes results covering agent tasks, programming, computer operations, scientific research, and visual output.

1. Agents and real work tasks

On Frontier-Bench v0.1, Opus 5 outperforms Opus 4.8 by more than twice while costing less per task. Anthropic also said that Opus 5 achieved new best results on Frontier-Bench and GDPval-AA.

These benchmarks focus more on completing the entire task rather than answering a static question, so they have certain reference value for agent applications. But production environments should also record the number of retries after a failure, because a more expensive model that reduces two retries at a time may end up being cheaper.

2. Programming and tool usage

At the highest effort settings of CursorBench 3.2, Opus 5 was only 0.5% shy of Fable 5’s best result, at about half the cost per task.

Officials also emphasized the model’s ability to handle complex tool chains. When migrating a Claude Code workflow, it is recommended to focus on testing the following types of tasks:

  • Track bugs across multiple files;
  • Locate the root cause after reading the log and perform additional tests;
  • Perform build, test and format check after modifying the code;
  • Identify constraints when requirements are incomplete rather than committing implementation prematurely;
  • Operation processes that require continuous invocation of multiple MCP tools.

3. Computer operation and automation

In OSWorld 2.0, the Opus 5 outperformed other models at a similar cost; officials say it beat the Fable 5’s best result at slightly more than one-third the cost.

On Zapier AutomationBench, Opus 5 scores approximately 1.5 times higher than the next best model for the same task cost. Even with the lowest effort level, it still accomplished the most tasks.

This means that low effort levels are not necessarily just for simple chat. For well-structured automation tasks, it may become a practical option for controlling tokens and latency.

4. Scientific research and visual tasks

Anthropic says the Opus 5 outperforms the Opus 4.8 in all life sciences tests. Among them, the internal organic chemistry evaluation increased by 10.2 percentage points, and the protein variation evaluation increased by 7.7 percentage points.

Additionally, web pages, slideshows, and other visuals generated by the model have been improved. However these are still reviews and examples provided by the publisher. When it comes to scientific research conclusions, medical information or experimental design, manual review and source verification must be retained, and higher benchmark scores cannot be regarded as a guarantee of factual correctness.

Claude Opus 5 API pricing

The base API prices for Opus 5 are as follows:

Project Price
Enter token $5 / 1 million tokens
Output token $25 / 1 million tokens
Fast Mode 2x base rate

Above are the base prices given in the release notes. Note that caching, batch processing or cloud platform channels may adopt different billing rules, and the official budget should still be based on the billing instructions of the calling channel at the time.

How much does a request cost approximately?

Assume that a long task uses cumulatively:

  • Enter 1 million tokens;
  • Output 200,000 tokens.

The base fee for the default model is:

1
2
3
输入:1 × 5 美元 = 5 美元
输出:0.2 × 25 美元 = 5 美元
合计:10 美元

If the same token usage is calculated at twice the rate of Fast Mode, it will be about $20.

Real agent tasks cannot be estimated by just a single call. A more useful metric is “cost per successful task”:

1
每个成功任务成本 = 总调用费用 ÷ 最终成功完成的任务数

If a cheap model retries frequently and requires manual takeover, the final cost may be higher than Opus 5; conversely, using Opus 5 for simple tasks may not yield enough benefits.

Calling Claude Opus 5 through the API

curl example

First put the API Key into the environment variable and then call the Messages API. Don’t write real keys into scripts or commit to Git repositories.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
export ANTHROPIC_API_KEY="your-api-key"

curl https://api.anthropic.com/v1/messages \
  --header "x-api-key: $ANTHROPIC_API_KEY" \
  --header "anthropic-version: 2023-06-01" \
  --header "content-type: application/json" \
  --data '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "分析这个服务的错误日志,给出根因、验证步骤和最小修复方案。"
      }
    ]
  }'

In Windows PowerShell, you can first set the current session environment variables:

1
$env:ANTHROPIC_API_KEY = "your-api-key"

Then use the Anthropic SDK, or construct the request according to the current official documentation. Environment variables only take effect for the current PowerShell session and are more suitable for temporary testing.

Python SDK Example

Install SDK:

1
python -m pip install -U anthropic

Create a minimal calling script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from anthropic import Anthropic

client = Anthropic()

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": (
                "检查下面的部署故障。先列假设,再给验证命令;"
                "没有证据时不要直接修改配置。"
            ),
        }
    ],
)

print(message.content[0].text)
print(message.usage)

Production environments should at least additionally record:

  • The model ID requested;
  • Input and output tokens;
  • Total time taken and first token delay;
  • Number of tool calls and reasons for failure;
  • Whether model rollback occurs;
  • Whether the final task is taken over manually.

Simply logging an HTTP 200 is not a sufficient measure of the success of the proxy task.

What scenarios is Fast Mode suitable for?

Opus 5’s Fast Mode is about 2.5 times faster than the default mode and costs 2 times the base rate. This mode is available with Claude Platform and is also available with Claude Code via usage credits.

Scenarios suitable for testing Fast Mode first include:

  • Interactive Claude Code sessions where developers are waiting;
  • Online accident analysis that requires rapid iteration;
  • Demonstrations, pair programming and real-time tool manipulation;
  • Processes where the impact of delay on business value is higher than the cost of a single token.

Scenarios that are not suitable for enabling by default include:

  • Nightly batch processing;
  • Offline code reviews that can be queued to run;
  • Large-scale low-priority data sorting;
  • An agent cycle where fee caps and monitoring have not yet been established.

It is recommended to set independent budget tags for Fast Mode and compare P50, P95 latency and cost per successful task. Turning it on for all requests just because you see “2.5 times faster” usually doesn’t lead to an optimal cost structure.

How should you use effort settings?

Opus 5 provides different effort settings to choose between intelligence level, token usage, latency and cost. Anthropic’s published data shows that low effort is still competitive in partially automated benchmarks, while the highest effort is more suitable for approaching the upper limit of model capabilities.

A layered strategy can be used:

Tasks Suggested starting points Upgrade conditions
Format conversion, fixed rule extraction Low effort Format error or omission rate exceeds standard
Conventional coding, single warehouse troubleshooting Medium effort Unable to locate after multiple tool calls
Cross-system failures, architecture design High effort Task value is enough to cover additional tokens
Cutting-edge research or difficult agent evaluation Maximum effort Verification of upper limit of ability required

The specific parameter names and available ranges may be updated with the SDK or platform, and the request fields should not be guessed based on the release. When accessing, please refer to the official documentation of the API version used.

How to choose: tier by task complexity

Use this order:

  1. Start with Sonnet 5 by default
    Good for most coding, documentation, Agent, and enterprise automation tasks.

  2. Move to Opus 4.8 for clearly complex tasks
    Long codebases, multiple tools, multi-step tasks, and stronger reasoning requirements.

  3. Try Fable 5 when you need the highest capability
    High-value, long-running, high-failure-cost tasks where price matters less.

  4. Use Haiku 4.5 for high-throughput light work
    Classification, extraction, summaries, support, batch processing, and low-latency interaction.

  5. Consider Mythos 5 only if you have access
    It is not a default option for ordinary developers.

Two migration and cost details

First, newer Claude models use a new tokenizer. Anthropic’s documentation says Opus 4.7 and later Opus models, Fable 5, Mythos 5, Mythos Preview, and Sonnet 5 may produce about 30% more tokens for the same text. Cost estimates should not rely on per-million-token price alone.

Second, 1M context does not mean every request should fill 1M context. Fable 5, Opus 4.8, and Sonnet 5 all support 1M tokens, but tool calls, caching, output, and multi-turn Agents add cost. A better deployment approach is:

  • Use prompt caching for common system prompts and long background context.
  • Chunk long documents first, then use stronger models for synthesis.
  • Send simple steps to Haiku or Sonnet, and escalate key decisions to Opus / Fable.
  • Run real task samples instead of relying only on official benchmarks.

A simple conclusion

Claude’s current model line is fairly clear:

  • Fable 5: highest capability for the hardest and highest-value tasks.
  • Opus 4.8: strong choice for complex Agent coding and enterprise work.
  • Sonnet 5: best daily default, balancing capability, speed, and price.
  • Haiku 4.5: fastest and cheapest for large-scale light tasks.
  • Mythos 5: limited availability, not a normal option.

If you are choosing Claude models for a product or internal workflow, the practical strategy is not to chase the highest tier. Split tasks: Haiku for lightweight batch work, Sonnet 5 as the default execution layer, Opus 4.8 for complex Agents and hard coding, and Fable 5 for the small set of tasks that are hardest, most expensive, and most worth it.

Model routing advice

When selecting Claude models, avoid having only one default model. A more useful design is routing: light batch jobs go to Haiku; daily coding and knowledge work go to Sonnet; complex repository tasks and multi-step Agents go to Opus; the highest-value and hardest tasks escalate to Fable.

The routing can start simple. Summaries, classification, and field extraction prefer Haiku. PR review, documentation generation, and ordinary code changes prefer Sonnet. Cross-module refactors, incident reviews, and complex planning prefer Opus. If Opus fails repeatedly or the task is very valuable, use Fable.

Every tier should also have exit conditions. Uncertain output, tool-call failures, repeated test failures, context over threshold, or tasks involving permissions or production data should trigger human confirmation instead of continued automation.

Cost evaluation method

The price table is only a rough estimate. Real cost depends on context length, cache hit rate, retries, output length, and human rework time. A more expensive model that completes a task once may be cheaper than multiple retries with a cheaper model.

For each task type, record three metrics: average token cost, average human review time, and the share of failures that require escalation. After two weeks, it is usually clear which tasks belong on Sonnet and which deserve Opus or Fable.

References: