← Back to all entries
2026-07-05 ✅ Best Practices

Choosing Between Sonnet 5 and Opus 4.8, and Building a Router

Choosing Between Sonnet 5 and Opus 4.8, and Building a Router — visual for 2026-07-05

Now That Sonnet 5 Beats Opus on Some Benchmarks, How Do You Actually Choose?

Sonnet 5's Terminal-Bench win over Opus 4.8 complicates what used to be a simpler rule of thumb ("Opus for hard problems, Sonnet for everything else"). A more useful framing post-launch: pick based on task shape, not a blanket tier preference.

⭐⭐⭐ anthropic.com
Claude Sonnet 5 Claude Opus 4.8 model selection benchmarks

A Simple Pattern for Routing Requests to the Cheapest Model That Works

With the pricing gap between Sonnet and Opus tiers now wider than the capability gap on many tasks, a routing layer that classifies request difficulty before picking a model pays for itself quickly at scale. A minimal version: run a fast, cheap classification pass (even Haiku-tier) to estimate task complexity, then route accordingly.

def route_model(task_complexity_score):
    if task_complexity_score < 0.3:
        return "claude-haiku-4-5"
    elif task_complexity_score < 0.7:
        return "claude-sonnet-5"
    else:
        return "claude-opus-4-8"
Start simple, tune with real data

Don't over-engineer the classifier initially — a handful of heuristics (request length, presence of code, keyword matching for "complex" task types) gets most of the value. Once you have production data, replace heuristics with observed failure rates per tier to tune the routing thresholds properly.

⭐⭐⭐ docs.claude.com
model routing cost optimisation Claude API architecture pattern
Source trust ratings ⭐⭐⭐ Official Anthropic  ·  ⭐⭐ Established press  ·  Community / research