Claude Sonnet 5 + CrewAI Agent Cost
Building with CrewAI on Claude Sonnet 5? Framework scaffolding rides on every step, context accumulates quadratically, and retries replay it all. This page prices that combination honestly — caching on by default.
For engineers and founders running production AI agents — estimates the real monthly bill with context growth, retries, framework overhead and prompt caching included.
Model prices from OpenRouter · updated 2026-07-13
01 Your setup
×1.3 tokens/step — Role prompts, backstories and inter-agent delegation chatter carried on every step. Our estimate, not a vendor benchmark.
02 Naive estimate vs real cost
You're overpaying $1,637/month vs the naive estimate — context keeps growing, and linear math doesn't see it.
Your real bill is 1.6× the naive estimate
Without prompt caching this would be $13,551 (5.0×) — caching is your single biggest lever.
03 Where the money goes
04 Cheapest model for this exact setup
Top 10 of 315models at this workload, models that can't hold the accumulated context ranked last — the search box above covers the rest. Cheap models are only a win if they can actually finish your steps.
Cost calculators for specific agent setups
Prices from OpenRouter, snapshot 2026-07-13, synced daily. Model: context accumulation N(N+1)/2 with first sends at input price and re-sends at the cache-read price when enabled; retry expectation f/(1−f) per step, replaying context and re-billing generated output; framework overhead is our per-step token estimate, not a vendor benchmark. Cache writes, cache misses and TTL expiry are not modeled — real caching saves somewhat less than shown. All math runs in your browser.
How the math works
The naive estimate is what most calculators (and most budgets) do: steps × tokens per step × price, as if every step were an independent call. This page's default workload — 10 steps of 2,500 tokens — looks like 25,000 input tokens per task.
A real agent re-sends its accumulated history on every step, because each LLM call is stateless. Step 1 sends 2,500 tokens, step 2 sends 5,000, step 10 sends 25,000 — the total is tokens × N(N+1)/2, which is 137,500 input tokens for the same task: 5.5× the naive count, and the ratio grows with every step you add.
Prompt caching (on by default here) re-bills those re-sent tokens at the provider's cache-read rate. Claude Sonnet 5 bills cached reads at $0.2/M against $2/M for fresh input — at this page's defaults that cuts the real bill from $13,551 to $4,337 per month (68% saved). Cache writes, misses and TTL expiry aren't modeled, so real savings run somewhat below this best case.
Failures multiply everything. At this page's default 12% per-step failure rate, only 28% of 10-step tasks finish without a single retry. Each expected retry (f/(1−f) per step) replays the accumulated context and re-generates the failed step's output — and providers bill both. Framework scaffolding rides along on every step; this page assumes CrewAI (×1.3 per-step token overhead, our estimate).
Worked example at this page's defaults — Claude Sonnet 5 at $2/$10 per million tokens, 10 steps × 2,500 tokens, 12% failures, 30,000 tasks a month, 400 output tokens per step: the naive estimate says $2,700/month; the real number is $4,337/month (1.6×). Prices sync daily from OpenRouter and every calculation runs in your browser with tested, open formulas — nothing is estimated by an AI.
Frequently asked questions
Why does a CrewAI agent on Claude Sonnet 5 cost so much more than the estimate?
Because each step re-sends the entire conversation history, input tokens grow quadratically — N(N+1)/2 instead of N. At this page's defaults that means 137,500 input tokens per task instead of the naive 25,000, and a real bill of $4,337/month against a naive estimate of $2,700 (1.6× with caching on, 5.0× without). Retries that replay history and per-step framework overhead widen it further.
How much does prompt caching save a CrewAI agent on Claude Sonnet 5?
Claude Sonnet 5 bills cached input reads at $0.2 per million tokens versus $2 for fresh input. Since re-sent history is the bulk of an agent's input bill, at this page's workload caching cuts the real cost from $13,551 to $4,337 per month — 68% — making it the single biggest lever here. Caveats: cache writes cost extra, entries expire, and roughly half the catalog publishes no cache pricing.
What failure rate should I assume for an agent?
Production agent steps fail more than people expect — malformed tool calls, schema mismatches, timeouts, hallucinated arguments. Without your own telemetry, 5–15% per step is a common range; this page defaults to 12%. At 12% across 10 steps, 28% of tasks complete with zero retries — and every retry replays the accumulated context.
What's the cheapest model for this workload?
At this page's default workload the current floor is Ling-2.6-flash at $24.08/month, followed by Nex-N2-Mini ($50.81) and Granite 4.0 Micro ($119) — refreshed daily from live prices. This page's default, Claude Sonnet 5, comes in at $4,337/month here — 180× the floor. Two catches: a cheap model that fails more steps can cost more after retries, and long runs can exceed a small model's context window (the ranking flags and demotes those).
What formula does this calculator use?
Real cost = first-sends (N·S at input price) + history re-sends (S·N(N+1)/2 − N·S, at the cache-read price when caching is on) + framework overhead (per-step token multiplier) + retries (f/(1−f) expected extra attempts per step, replaying context and re-billing generated output) + outputs (N·400 tokens at output price). The naive baseline is simply N·S at input price plus outputs.
Are these model prices current?
Prices sync daily from OpenRouter's public catalog and the page shows its snapshot date. If a sync ever fails, the site keeps serving the last verified snapshot rather than blank or invented numbers. All math runs client-side with tested code.