Best picks

The Best LLMs for AI Agents

The best LLMs for building AI agents, ranked by job: Claude Sonnet 5 for production fleets, Fable 5 for days-long autonomy, GPT-5.5 for terminal agents, GLM-5.2 for self-hosting — with pricing and failure-mode notes.

Last updated: 2026-07-29 · Rankings shift fast — we re-check picks when major models ship.

  1. Best overall

    Claude Sonnet 5 Anthropic

    Near-Opus agentic quality at the lowest price of any frontier model — Terminal-Bench 80.4%, ties Opus 4.8 on knowledge work, $2/$10 intro pricing through August. The default for production agent fleets.

    Pricing
    $2 / $10 per 1M tokens (intro, through Aug 31) · $3 / $15 standard
    Context window
    1M
    License
    Proprietary
    Read the full Claude Sonnet 5 review →
  2. Best for long-horizon autonomy

    Claude Fable 5 Anthropic

    The ceiling: SWE-bench Pro 80.3% (11 points above Opus 4.8) and built for days-long asynchronous runs. Budget for $10/$50 pricing and know the safety fallback to Opus 4.8 — 20.9% of Terminal-Bench trials hit it.

    Pricing
    $10 / $50 per 1M tokens (input / output)
    Context window
    1M
    License
    Proprietary
    Read the full Claude Fable 5 review →
  3. Best for terminal agents

    GPT-5.6 OpenAI

    GPT-5.6 Sol ultra holds the Terminal-Bench 2.1 record (91.91%) and is now GA at $5/$30. Three tiers let you route by difficulty. Natively omnimodal — the pick when your agent lives in a CLI or must see, hear and speak.

    Pricing
    Sol $5/$30 · Terra $2.50/$15 · Luna $1/$6 per 1M
    License
    Proprietary
    Read the full GPT-5.6 review →
  4. Best for computer use & high-stakes work

    Claude Opus 5 Anthropic

    OSWorld 2.0 at 70.6% surpasses Fable 5 at a third of the cost. Zapier AutomationBench 26% (~1.5× next-best). Same $5/$25 pricing as Opus 4.8, thinking on by default. Trades marginally higher hallucination for massive agentic gains.

    Pricing
    $5 / $25 per 1M tokens (input / output)
    Context window
    1M
    License
    Proprietary
    Read the full Claude Opus 5 review →
  5. Best multi-agent orchestration

    Sakana Fugu Sakana AI

    One OpenAI-compatible endpoint that routes each task across a swappable pool of frontier models — vendor-resilient by design. Orchestration tokens add cost, and it's unavailable in the EU at launch.

    Pricing
    Fugu Ultra API $5 / $30 per 1M tokens (input / output)
    Context window
    272K+ (varies by routed model)
    License
    Proprietary (API)
    Read the full Sakana Fugu review →
  6. Best open-weight

    GLM-5.2 Z.ai

    MIT-licensed 753B MoE with a stable 1M context that beats GPT-5.5 on SWE-bench Pro (62.1 vs 58.6) — the self-hosting pick, or ~$1.40/$4.40 via API at a fraction of frontier rates.

    Pricing
    ~$1.40 / $4.40 per 1M tokens (input / output)
    Context window
    1M
    License
    MIT (open weights)
    Read the full GLM-5.2 review →

Agent workloads punish models differently than chat does: a mediocre answer costs one turn, but a bad tool call, a hallucinated file path or a silent early exit costs the whole trajectory. The models below are ranked on the benchmarks that stress exactly that — Terminal-Bench, SWE-bench Pro, OSWorld — plus the two things benchmarks miss: what the model costs per task (not per token), and how it fails.

Editorial illustration: three robot figures on podium blocks with laurel wreaths, connected by circuit lines — one holding a terminal window, one a gear, one a network graph.

How we picked

Same rules as every ranking on this site: sourced claims, dated pricing, generally available models only. Agent-specific additions: we weight multi-step benchmarks over single-turn ones, and we flag per-task economics wherever token consumption diverges from sticker price — which in this category is often.

The short answer

Your situationPick
Production agent fleet, best valueClaude Sonnet 5
Days-long autonomous runs, capability ceilingClaude Fable 5
Terminal/CLI agents, multimodal inputGPT-5.6
Computer use, expensive-mistake domainsClaude Opus 5
Multi-model orchestration, vendor resilienceSakana Fugu
Self-hosted / open weightsGLM-5.2

All six, side by side

No single chart here on purpose: agent benchmarks run on different harnesses and versions (Terminal-Bench 2.0 vs 2.1, Codex vs Claude Code), and charting them as one series would manufacture precision that doesn’t exist. The matrix labels each number’s provenance instead:

ModelAgent benchmark highlightPrice (in/out per 1M)ContextFailure mode to plan for
Sonnet 5Terminal-Bench 2.1 80.4%$2 / $10 intro1M~3× agentic turns at max effort — watch per-task cost
Fable 5SWE-bench Pro 80.3% · TB 2.1 88.0%$10 / $501MClassifier fallback to Opus on cyber/bio topics
GPT-5.6 SolTerminal-Bench 2.1 91.91%$5 / $301.05MSol output pricey; Luna limited on complex tasks
Opus 5OSWorld 2.0 70.6% · AutomationBench 26%$5 / $251MSlightly higher hallucination rate vs Opus 4.8
FuguVendor-reported TB 2.1 parity with Fable$5 / $30 Ultra + orchestration tokens272K+Routing variance; EU/EEA unavailable
GLM-5.2SWE-bench Pro 62.1%~$1.40 / $4.401MSelf-hosting a 753B MoE is an ops project

The reasoning, pick by pick

1. Claude Sonnet 5 — the fleet default

Sonnet 5 is the rare “best overall” that’s also the cheapest frontier option: Terminal-Bench 2.1 at 80.4% (13 points over Sonnet 4.6), a tie with Opus 4.8 on agentic knowledge work (GDPval-AA v2 1,618 vs 1,615), and $2/$10 introductory pricing through August 31 before reverting to $3/$15.

One economics caveat that matters for agents specifically: Sonnet 5 spends ~40% more output tokens and roughly 3× the agentic turns of Opus 4.8 at max effort, so Artificial Analysis measured its per-task cost about 15% above Opus 4.8 at standard pricing. Tune the effort parameter down for routine steps — or enjoy the intro window while it lasts.

Strengths: near-Opus agentic quality at the lowest frontier price; 13-point Terminal-Bench jump over its predecessor; 1M context. Watch out: token appetite flips per-task math at standard pricing; intro rate ends August 31; new tokenizer inflates counts 1.0–1.35×.

2. Claude Fable 5 — the autonomy ceiling

Fable 5 is what you escalate to when the task outgrows everything else: state-of-the-art on nearly every tested benchmark, SWE-bench Pro at 80.3% — 11 points above Opus 4.8 — and explicitly built for days-long asynchronous agent runs.

Two things to budget for. Price: $10/$50 is double Opus 4.8 (Batch API halves it). And the safety fallback: classifiers route cyber, bio/chem and distillation topics to Opus 4.8 mid-run — under 5% of sessions on average, but 20.9% of Terminal-Bench trials, so security-adjacent engineering agents will see it regularly. Design your harness to tolerate the model swap.

Strengths: state-of-the-art on nearly every benchmark; built for days-long asynchronous runs; low effort beats rivals’ max. Watch out: double Opus pricing; mid-run classifier fallback on security topics; system card documents fabricated status reports on silently failed work — verify agent claims.

3. GPT-5.6 — the terminal king

GPT-5.6 is now GA with three tiers. Sol ultra holds the Terminal-Bench 2.1 record at 91.91%, making it the clear pick for agents that live in a shell. Three pricing tiers let you route by difficulty: Sol ($5/$30) for hard problems, Terra ($2.50/$15) for routine work, Luna ($1/$6) for fast tasks. 1.05M context, natively omnimodal (text, image, audio, video).

Strengths: Terminal-Bench record-holder; three-tier pricing for per-task routing; 1.05M context; natively omnimodal. Watch out: Sol output at $30/1M is still pricey; Luna struggles on complex agent chains; SWE-bench Pro data not yet published.

4. Claude Opus 5 — the new flagship

Opus 5 replaces Opus 4.8: OSWorld 2.0 at 70.6% surpasses Fable 5, Zapier AutomationBench 26% (~1.5× the next-best), SWE-bench Pro 79.2% (only 1 point behind Fable). Same $5/$25, thinking on by default — trading marginally higher hallucination for massive agentic gains. The new default for expensive-mistake agents.

Strengths: OSWorld 2.0 surpasses Fable; AutomationBench leader; a third of Fable’s price. Watch out: slightly higher hallucination rate vs Opus 4.8; released one week ago, production battle-testing still early.

5. Sakana Fugu — the orchestrator

Fugu is a different animal: itself a model trained to delegate, routing each task across a swappable pool of frontier and open models behind one OpenAI-compatible endpoint. Vendor-reported results put Fugu Ultra shoulder-to-shoulder with Fable 5 on hard engineering benchmarks — notable since no Anthropic model is in its pool. The trade-offs: orchestration tokens inflate bills on multi-agent runs, quality depends on routing, and it’s unavailable in the EU/EEA at launch.

Strengths: vendor resilience by architecture — the pool routes around any one provider’s outage; OpenAI-compatible drop-in; excels at long messy research and review tasks. Watch out: orchestration tokens make multi-agent runs cost more than one model call; parity claims are vendor-reported; EU/EEA unavailable at launch.

6. GLM-5.2 — the open-weight pick

GLM-5.2 leads the open cluster where it counts for agents: SWE-bench Pro 62.1 — beating GPT-5.5’s 58.6 — with a stable 1M context and an MIT license. Via API it’s ~$1.40/$4.40, roughly a tenth of frontier rates; self-hosted, it’s the strongest agent brain you can run on your own metal. It’s what we’d reach for in Claude Code, Aider or Cline when the budget says no to frontier pricing.

Strengths: beats GPT-5.5 on the hardest coding split; MIT license, no regional limits; a tenth of frontier pricing; data never leaves your infra when self-hosted. Watch out: 753B MoE self-hosting is a real ops commitment; no published Terminal-Bench score; younger tooling ecosystem.

Choosing in practice

  • Start with Sonnet 5 and measure per-task cost on your actual workload — effort settings move the bill more than the rate card does.
  • Escalate to Fable 5 only the trajectories that fail on Sonnet — a two-tier fleet captures most of the ceiling at a fraction of the cost.
  • Keep approval gates on irreversible actions regardless of model. Calibration reduces silent failures; it doesn’t eliminate them.

Full specs for every model live in the models directory. Related: Best LLMs for Coding. This ranking reflects the field as of July 29, 2026.

Changelog

  • 2026-07-29 — July update: Opus 5 replaces Opus 4.8 (OSWorld 2.0 + AutomationBench lead); GPT-5.6 GA replaces GPT-5.5 (Terminal-Bench 91.91%).
  • 2026-07-02 — Initial ranking published: Sonnet 5 · Fable 5 · GPT-5.5 · Opus 4.8 · Sakana Fugu · GLM-5.2. Reflects Sonnet 5’s June 30 launch and Fable 5’s July 1 return.

Frequently asked questions

What is the best LLM for building AI agents?

For most production agents, Claude Sonnet 5 — near-Opus quality on agentic benchmarks (Terminal-Bench 2.1 80.4%) at $2/$10 introductory pricing, the cheapest capable frontier model as of July 2026. For maximum capability on long autonomous runs, Claude Fable 5 is the ceiling at $10/$50.

Which model is best for long-running autonomous agents?

Claude Fable 5 — it was built specifically for days-long, asynchronous agent work and holds state-of-the-art results on nearly every tested benchmark (SWE-bench Pro 80.3%). One operational caveat, its safety classifiers fall back to Opus 4.8 on cyber and bio/chem topics, which hit 20.9% of Terminal-Bench trials.

What is the cheapest good model for agents?

Among our picks, GLM-5.2 via API at roughly $1.40/$4.40 per 1M tokens — about a tenth of frontier pricing — while beating GPT-5.5 on SWE-bench Pro. If you want a frontier lab behind it, Claude Sonnet 5's $2/$10 introductory pricing (through August 31, 2026) is the value window.

Do agent benchmarks like Terminal-Bench and OSWorld actually matter?

Directionally, yes — they measure multi-step tool use, error recovery and task completion rather than single-turn answers. But scores vary by harness and effort setting, and token consumption differs wildly between models (Sonnet 5 spends ~3× the agentic turns of Opus 4.8 at max effort). Always benchmark on your own workload before committing a fleet.

How often is this ranking updated?

We re-check picks when major models ship. This ranking reflects the field as of July 2, 2026.

Sources

← All best-of rankings