---
title: "Claude Opus 5 Effort Parameter Guide: How to Reduce Claude API Costs Without Switching Models"
description: "How to use the Claude Opus 5 effort parameter (low, medium, high, xhigh, max) to cut Claude API costs. Real per-request cost numbers, working Python code, and why we retired our Haiku/Sonnet/Opus routing layer."
image: "https://foundrysoft.co/api/og?type=article&title=Claude+Opus+5+Effort+Parameter+Guide%3A+How+to+Reduce+Claude+API+Costs+Without+Switching+Models&cat=AI+Engineering&rt=9+min+read&au=Varun+Raj+Manoharan&dt=2026-07-25"
url: "https://foundrysoft.co/blog/claude-opus-5-effort-parameter-cost-routing"
---

AI Engineering 2026-07-25 9 min read

# Claude Opus 5 Effort Parameter Guide: How to Reduce Claude API Costs Without Switching Models

How to use the Claude Opus 5 effort parameter (low, medium, high, xhigh, max) to cut Claude API costs. Real per-request cost numbers, working Python code, and why we retired our Haiku/Sonnet/Opus routing layer.

![Varun Raj Manoharan](https://foundrysoft.co/images/about/founder.webp)

Varun Raj Manoharan

Claude Opus 5 Anthropic Claude API Cost Optimization Effort Python

Every production LLM stack I've audited in the last year has the same component: a routing layer that classifies incoming work and dispatches it to Haiku, Sonnet, or Opus based on difficulty. Everyone builds it. Everyone maintains three sets of prompts for it. And everyone eventually gets burned by it, because the router itself misclassifies, and because switching models mid-conversation throws away your prompt cache.

Claude Opus 5 launched yesterday with a different answer to "how do I reduce my Claude API costs": one model and a dial. The `effort` parameter (`low`, `medium`, `high`, `xhigh`, `max`) controls how much the model thinks and how much work it does per request. Anthropic is explicitly positioning it as the toggle between cost and capability. So I rebuilt one of our client pipelines, an intake system handling everything from ticket triage to contract clause analysis, on a single `claude-opus-5` deployment and retired the three-model router. Here's what I learned, with real cost numbers.

### How the Claude Opus 5 effort parameter works

Effort isn't a token cap the model ignores. Opus 5 respects effort levels strictly, especially at the low end. At `low` and `medium` it scopes work to exactly what was asked: fewer tool calls, more consolidated ones, less preamble. At `xhigh` it thinks and acts far more per request. The parameter goes inside `output_config`, and it defaults to `high` when unset. Set it explicitly on every route or you're paying `high` prices for `low` work.

Python

Copy

```python
import anthropic

client = anthropic.Anthropic()

EFFORT_BY_ROUTE = {
    "triage": "low",          # classify and route, sub-second matters
    "draft_reply": "medium",  # customer-facing text
    "account_review": "high", # multi-document reasoning
    "contract_analysis": "xhigh",  # the work clients pay us for
}

def run(route: str, messages: list) -> anthropic.types.Message:
    return client.messages.create(
        model="claude-opus-5",
        max_tokens=64000 if route == "contract_analysis" else 8000,
        output_config={"effort": EFFORT_BY_ROUTE[route]},
        messages=messages,
    )
```

Note the `max_tokens` bump on the `xhigh` route. Thinking is on by default on Opus 5 and counts against `max_tokens`, and at `xhigh` the model uses that room. Anthropic recommends starting at 64K for the top effort levels. You can run a route with thinking fully off if you want, with one restriction: `thinking: {"type": "disabled"}` is only accepted at effort `high` and below. The top two levels require thinking.

### Claude Opus 5 cost per request, measured

Effort doesn't change Claude Opus 5 pricing per token. Everything bills at $5/$25 per million. What changes is how many tokens each request spends. On our eval set of 500 historical intake items, the same triage prompt cost this much per 1,000 requests at each level (output tokens, thinking included):

-   `low`: ~180K output tokens, about **$4.50**
-   `medium`: ~410K output tokens, about **$10.25**
-   `high` (the default): ~890K output tokens, about **$22.25**
-   `xhigh`: ~2.1M output tokens, about **$52.50**

The spread between `low` and the default is roughly 5x on this workload. That's the whole argument for setting effort explicitly. A triage route left on the default was quietly costing five times what it needed to, and classification accuracy at `low` was identical. Your numbers will differ, so sweep rather than trusting my table: run each route at three effort levels against your evals and pick per route.

### Why one model beat our three-model router

The obvious objection first: Haiku is still $1/$5, so `low`\-effort Opus 5 costs more per token than Haiku for bottom-tier work. True. Three things made the single-model setup win anyway for this pipeline.

**Prompt cache coherence.** Caches are model-scoped. Every time our old router escalated a conversation from Sonnet to Opus, the entire cached prefix (system prompt, tool definitions, conversation history) was reprocessed cold at full input price. On one model, an escalation is just a different `output_config` on the next request. Our cache hit rate went from 62% to 91% after consolidating, and cache reads bill at about a tenth of base input price. On long conversations that pays for the Haiku delta several times over.

**One prompt, one eval suite.** We maintained three variants of every system prompt because what steered Haiku over-triggered Opus. That matrix is gone.

**Escalation without a router model.** The best trick is also the dumbest: run at `low`, and when the model signals low confidence in its structured output, re-run the same request at `xhigh`. The retry reads the same cache. The model becomes its own router.

Python

Copy

```python
result = run_with_effort(messages, "low")
if result.parsed["confidence"] < 0.7:
    result = run_with_effort(messages, "xhigh")  # same cache, more depth
```

### When Haiku still wins

If your bottom tier is genuinely trivial (sentiment tags, yes/no gates) and runs at millions of requests per day, Haiku's raw per-token price still wins. The cache argument can't save you there because those requests are short and stateless anyway. Latency-critical paths also care that Opus 5's comparative latency is "moderate" while Haiku's is "fastest"; `low` effort narrows that gap without closing it.

The mental model I've settled on: effort replaces model routing _within_ a pipeline, where requests share context and caches. Picking the right model _per pipeline_ is still your job.

### Two setup notes

First, effort defaults to `high` on the Claude API and Claude Code specifically. Don't assume another surface behaves the same way. Second, if your stack used `budget_tokens` to control thinking spend, that parameter now returns a 400 on Opus 5. Effort is the replacement, and there's no clean formula mapping a token budget to a level, so measure.

One afternoon of migration bought us a deleted router service and a cost dashboard with a single line on it. The effort dial sounds like the most boring feature in the Claude Opus 5 launch. It changed our architecture more than anything else in it.

#### Related reading

[Claude Opus 5 vs Grok 4.5 vs Muse Spark 1.1: Which Agentic Model to Use in 2026

An independent comparison of the three agentic models that launched this month. Real pricing, production failure modes, cost per completed task, and the routing table we actually run, not a benchmark aggregation.

Claude Opus 5 Grok 4.5 Muse Spark

](https://foundrysoft.co/blog/claude-opus-5-vs-grok-4-5-vs-muse-spark-comparison)[Claude Opus 5 Batch API Tutorial: AI Contract Data Extraction at Scale, with Real Costs

A step-by-step tutorial for bulk AI document extraction with the Claude Opus 5 Batch API: structured outputs with JSON schemas, 50% batch pricing, the 300K output beta, and the real cost of processing 40,000 vendor contracts.

Claude Opus 5 Anthropic Batch API

](https://foundrysoft.co/blog/claude-opus-5-batch-api-contract-extraction)[How to Build a Long-Running AI Agent with the Claude Opus 5 API: An Overnight Build Log

A hands-on guide to building autonomous AI agents on the Claude Opus 5 API: the agent loop in Python, mid-conversation system messages, prompt caching costs, and what an overnight dependency-upgrade run actually cost.

Claude Opus 5 Anthropic Claude API

](https://foundrysoft.co/blog/claude-opus-5-overnight-long-horizon-agent)

#### Next Article

[

How to Build a Long-Running AI Agent with the Claude Opus 5 API: An Overnight Build Log

](https://foundrysoft.co/blog/claude-opus-5-overnight-long-horizon-agent)

Available for new projects

## Let's build something great.

Have a project in mind? We are an elite software and AI development studio ready to bring your ideas to production. Let's talk about your roadmap.

Start a Project [See our work](https://foundrysoft.co/work)

```json
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "FoundrySoft",
  "url": "https://foundrysoft.co",
  "logo": "https://foundrysoft.co/logo.svg",
  "description": "FoundrySoft builds production-grade software and AI systems for US companies, from an India-based team of senior engineers.",
  "sameAs": [
    "https://github.com/foundrysofthq",
    "https://www.linkedin.com/company/foundrysoft",
    "https://www.instagram.com/foundrysoft/"
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "FoundrySoft",
  "url": "https://foundrysoft.co"
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "Claude Opus 5 Effort Parameter Guide: How to Reduce Claude API Costs Without Switching Models",
  "description": "How to use the Claude Opus 5 effort parameter (low, medium, high, xhigh, max) to cut Claude API costs. Real per-request cost numbers, working Python code, and why we retired our Haiku/Sonnet/Opus routing layer.",
  "url": "https://foundrysoft.co/blog/claude-opus-5-effort-parameter-cost-routing",
  "mainEntityOfPage": "https://foundrysoft.co/blog/claude-opus-5-effort-parameter-cost-routing",
  "image": [
    "https://foundrysoft.co/api/og?type=article&title=Claude+Opus+5+Effort+Parameter+Guide%3A+How+to+Reduce+Claude+API+Costs+Without+Switching+Models&cat=AI+Engineering&rt=9+min+read&au=Varun+Raj+Manoharan&dt=2026-07-25"
  ],
  "datePublished": "2026-07-25",
  "dateModified": "2026-07-25",
  "keywords": "Claude Opus 5, Anthropic, Claude API, Cost Optimization, Effort, Python",
  "author": {
    "@type": "Person",
    "name": "Varun Raj Manoharan"
  },
  "publisher": {
    "@type": "Organization",
    "name": "FoundrySoft",
    "logo": {
      "@type": "ImageObject",
      "url": "https://foundrysoft.co/logo.svg"
    }
  }
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://foundrysoft.co/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Blog",
      "item": "https://foundrysoft.co/blog"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Claude Opus 5 Effort Parameter Guide: How to Reduce Claude API Costs Without Switching Models",
      "item": "https://foundrysoft.co/blog/claude-opus-5-effort-parameter-cost-routing"
    }
  ]
}
```
