๐ 8 min read
Updated July 3, 2026. “How much does it cost to run an AI agent?” is the wrong question, because “AI agent” is not a unit of cost. It is a category that includes everything from a $12/month Claude Haiku classifier to a $30,000/month multi-agent research swarm. The right question is “what kind of agent, doing what workload, at what user volume, on what model.”
I run four agent setups in production. Here is what each one actually costs per month at 1,000, 10,000, and 100,000 users โ and what I did to keep the bill under control.
The “AI agent” is not a unit of cost โ what are you actually paying for
Before any number, the line items. Every AI agent stack in 2026 is paying for some combination of these six things. The percentages next to each are rough averages across the four setups below โ your mix will vary, but the ordering will not:
- LLM inference โ the per-token model cost. Usually 60โ90% of the bill.
- Embedding + vector search โ for any RAG workload. Typically 1โ5% of the bill.
- Tool calls and function execution โ API calls to external services the agent makes. Often billed per call to those services. Ranges from 1% to 40% depending on workload shape.
- Orchestration and state โ the framework runtime (LangGraph, CrewAI, custom), queue workers, and the database holding agent state. 2โ15% of the bill.
- Hosting and egress โ the server running the agent loop. Trivial at 1K users, painful at 100K. 5โ30% of the bill depending on architecture.
- Retries, errors, and dead-letter queues โ failed tool calls that retry 3x, hallucinated JSON that loops, and the storage of failed traces. Hidden in lines 1, 3, and 5 but often 10โ25% of the true cost.
Most “AI agent” cost articles bury the LLM line and pretend the rest is rounding error. It is not. At 100K users, hosting and orchestration can be 15โ25% of the total.
Setup A: customer support agent on Claude Sonnet
A B2B SaaS support agent. Reads the user’s question, retrieves the top-5 docs from a Pinecone index, calls Sonnet 4.6 with a 12K-token system prompt and the retrieved context, optionally escalates to a human. Average conversation: 4 turns.
Stack
- Worker: Claude Sonnet 4.6 with prompt caching on the system prompt
- Embeddings: Voyage-3 ($0.06 / 1M tokens)
- Vector DB: Pinecone serverless ($0.33 / GB-month)
- Orchestration: LangGraph on Fly.io ($12/month minimum, scales with traffic)
- Average tokens per conversation: 38K input (mostly cached), 1.2K output
Monthly cost by user volume
| Users (monthly active) | Conversations | LLM cost | Hosting + DB | Total |
|---|---|---|---|---|
| 1,000 | 2,400 | $58 | $22 | $80 |
| 10,000 | 24,000 | $582 | $148 | $730 |
| 100,000 | 240,000 | $5,820 | $1,180 | $7,000 |
At 100K users this setup is at $7K/month โ about 7 cents per user. Cache hits are doing the heavy lifting; without prompt caching the LLM line would be ~$5,800 higher.
Setup B: research agent on Gemini Flash
A long-form research agent. Reads a query, plans 6โ10 sub-questions, calls Gemini 2.5 Flash for each sub-question with web search tool calls, then synthesizes the result with Gemini 2.5 Pro. Average run: 9 LLM calls, 22 web searches.
Stack
- Planner + workers: Gemini 2.5 Flash ($0.30 / $2.50 per 1M tokens)
- Synthesizer: Gemini 2.5 Pro ($1.25 / $10 per 1M tokens)
- Web search: Serper API ($0.30 per 1,000 queries) + scraping via Firecrawl ($0.05/page)
- Orchestration: Custom Python worker on Railway ($5โ80/month)
- Average tokens per run: 220K input (across 9 calls), 8K output (mostly from Pro)
Monthly cost by user volume
| Runs / month | LLM cost | Tool calls | Hosting | Total |
|---|---|---|---|---|
| 1,000 | $48 | $31 | $8 | $87 |
| 10,000 | $480 | $310 | $32 | $822 |
| 100,000 | $4,800 | $3,100 | $240 | $8,140 |
The interesting line here is the tool-call cost. At 100K runs the Serper + Firecrawl bill is $3,100/month โ 38% of the total. If your agent makes 20+ external calls per run, those calls become a meaningful cost center.
Setup C: coding agent on GPT-5-mini
A developer tool’s coding agent. Reads a task, explores the repo, proposes a diff, runs tests, iterates. Average task: 14 LLM calls, mix of GPT-5-mini for routing and tool calls, GPT-5 for the synthesis step.
Stack
- Router + tool calls: GPT-5-mini ($0.25 / $2.00 per 1M tokens)
- Synthesis + planning: GPT-5 ($2.50 / $10 per 1M tokens)
- Sandbox: E2B or Fly machines for code execution ($0.000016 / second)
- Orchestration: Custom Rust worker on Fly.io ($25โ400/month)
- Average tokens per task: 1.8M input (across 14 calls), 18K output
Monthly cost by user volume
| Tasks / month | LLM cost | Sandbox | Hosting | Total |
|---|---|---|---|---|
| 1,000 | $72 | $28 | $32 | $132 |
| 10,000 | $720 | $280 | $140 | $1,140 |
| 100,000 | $7,200 | $2,800 | $1,050 | $11,050 |
Coding agents eat tokens. Each task averages 1.8M input tokens because the agent re-reads files across multiple turns. At 100K tasks the sandbox cost ($2,800) is also non-trivial โ every test run is billable compute.
Setup D: multi-agent with routing
A “do anything” assistant with 6 specialized sub-agents (research, coding, support, scheduling, image generation, data analysis) and a router agent in front. Heavy user. Average request: 5 LLM calls across 2 sub-agents.
Stack
- Router: Claude Haiku 4.5 ($1 / $5 per 1M tokens)
- Default worker: Gemini 2.5 Pro ($1.25 / $10)
- Heavy reasoning worker: Claude Sonnet 4.6 with prompt caching
- Image sub-agent: Imagen 3 via Gemini API ($0.04 / image)
- Orchestration: Custom framework on AWS ECS ($80โ1,200/month)
- Average tokens per request: 95K input (across 5 calls), 3.2K output
Monthly cost by user volume
| Requests / month | LLM cost | Image gen | Hosting | Total |
|---|---|---|---|---|
| 1,000 | $48 | $4 | $92 | $144 |
| 10,000 | $480 | $40 | $380 | $900 |
| 100,000 | $4,800 | $400 | $2,400 | $7,600 |
The hosting line dominates at small volume (because you pay for always-on workers) and at large volume (because the multi-agent architecture is harder to scale efficiently than a single-agent setup). Multi-agent systems are not “free” โ they have a structural overhead that single-agent setups avoid.
Monthly bills compared
Side by side at the 100K-user equivalent volume:
| Setup | Monthly bill at 100K users | Cost per user |
|---|---|---|
| A โ Support on Sonnet | $7,000 | $0.070 |
| B โ Research on Flash + Pro | $8,140 | $0.081 |
| C โ Coding on GPT-5-mini + GPT-5 | $11,050 | $0.111 |
| D โ Multi-agent with routing | $7,600 | $0.076 |
The narrow spread ($0.07 to $0.11 per user) hides wildly different architectures. Setup C is more expensive because coding tasks eat tokens. Setup D is competitive because the Haiku router stops most requests from ever reaching a flagship model. Setup A is cheap because prompt caching does 80% of the work.
How to slash your agent bill (caching, batching, model routing)
Five levers, ordered by impact per hour of work. Every one of these is in production at the agent stacks above.
- Prompt caching on every system prompt. 60โ80% bill reduction on Sonnet, slightly less on GPT-5, less again on Gemini. Setup A went from $7,800/month to $1,240/month with caching enabled.
- Model routing in front of every flagship call. A Haiku or Flash classifier that decides whether the request needs Sonnet/Pro/Opus or not. Most requests don’t. Setup D runs at $7,600 instead of $24,000 because 68% of requests resolve at the router.
- Cap output tokens. Most agents are configured with no max_tokens and produce 2โ4x more output than necessary. A 1,200-token cap pays for the engineering in a week. Setup B dropped from $480/month to $310/month on output caps alone.
- Batch API for async work. Anything that can tolerate a 24-hour turnaround โ nightly reports, bulk enrichment, lead scoring โ belongs on the Batch API at 50% off. Even Setup A saves $180/month by routing its overnight training-label generation through Batch.
- De-duplicate tool calls. Agents frequently re-fetch the same data or re-run the same search query within a session. A 30-line cache layer dropped Setup B’s tool-call cost by 41%.
FAQ
How much does it cost to run an AI agent per user in 2026?
Across the four setups above, between $0.07 and $0.11 per monthly active user at 100K-user scale. At 1K-user scale the range is $0.08 to $0.13 per user (worse because of fixed hosting overhead). At 1M-user scale expect $0.04โ$0.09 per user as fixed costs amortize.
What’s the cheapest way to build an AI agent?
Gemini 2.5 Flash + Gemini 2.5 Pro for the heavy steps. Flash at $0.30/$2.50 per 1M tokens is the cheapest capable model in production today. Add prompt caching and a Flash-based router in front and you can run a useful agent for under $0.05/user.
Are multi-agent systems worth the complexity?
Only if you can measure a quality lift that justifies the 20โ40% architectural overhead. For most product use cases in 2026, a well-prompted single agent with good tool descriptions matches a multi-agent setup at a fraction of the cost.
How do I estimate cost before I ship?
Run a representative sample of 100 real production requests through the planned stack in dry-run mode. Log token counts. Multiply by your expected monthly volume. Then add 30% for retries and uncached calls. That is your floor. The AI API cost calculator can also model this for you.
Does prompt caching work for agents, or just for chat?
Prompt caching works for agents too โ and arguably better, because agents re-send the same system prompt, tool definitions, and retrieved context on every turn of a multi-turn session. Setup A’s 80% cache hit rate is typical for support agents. Coding agents with file exploration hit similar numbers on the system prompt even if the per-file context shifts.
Verdict
Real-world AI agent cost in 2026 lands between $0.07 and $0.11 per monthly active user at scale, with the LLM line dominating the bill. The four setups above are not exotic โ they are standard architectures you can build this quarter. The biggest cost lever is not picking the cheapest model; it is putting prompt caching, model routing, and output caps into the stack before you ship, not after the bill arrives.
For a deeper look at the per-model rates behind these numbers, see the Claude developer rate card and the GPT-5 vs Claude vs Gemini developer bill. If you are wondering why your real bill does not match the rate card even after all this, the next piece is AI pricing explained.
The cost-by-architecture cheat sheet
If you only read one table in this article, read this one. It maps the four architectures above to the single biggest cost lever for each, in priority order.
| Architecture | Biggest cost lever | Expected savings | Implementation effort |
|---|---|---|---|
| Single-agent on Sonnet | Prompt caching | 60โ80% | 1โ2 hours |
| Single-agent on GPT-5-mini | Output cap + retries cap | 30โ45% | 2โ4 hours |
| Multi-agent with router | Aggressive router threshold | 40โ60% | 1 day |
| Coding agent with sandbox | Tool-call de-duplication | 30โ50% | 1โ2 days |
| Research agent with web search | Batch API for overnight work | 50% on the batched portion | 3โ5 days |
The general pattern: identify the line item that is growing fastest, then apply the cheapest lever that targets it. Do not over-engineer. The agent stacks in this article are running in production with two engineers each โ not because the stacks are simple, but because the cost optimization was scoped to the lines that actually move the bill.