How Much Does an Agent Cost Per Hour?
The real breakdown of what an agent costs to run. Token pricing, subscription pricing, hidden costs, and how to estimate your monthly bill before you start.
Goal
Know how agent pricing works and be able to estimate your monthly costs before you commit
What You'll Need
⏱ Time: 15 minutes | 📋 Tasks:
- Your preferred AI model's pricing page open (OpenAI, Anthropic, or whichever you use)
- An idea of what kind of tasks you'd run with an agent
The First Question Everyone Asks
Before you install anything, you want to know: is this going to cost me a fortune?
The honest answer: it depends on what you do. A quick research task costs pennies. A full-day code review could cost more than your Netflix subscription. But here's the good news — agent costs are predictable once you understand a few variables, and most people spend less than they expect.
Model Tiers: Complex Reasoning, Mid, and Flash
Not all models are created equal, and the cheapest option isn't always the cheapest in practice — because a weaker model may need more attempts, more tool calls, and more tokens to solve the same problem.
Models fall into three rough tiers:
Flash Models
Price range: $0.03 - $0.15/M in, $0.06 - $0.60/M out | Speed: Fastest | Best for: Simple Q&A, classification, data extraction, routine email processing, and any task where the answer is straightforward and well-scoped.
These are your workhorses for high-volume, low-complexity work. A flash model can categorize 10,000 support tickets for pocket change. But give it a novel coding problem or a nuanced analytical task, and it may produce a shallow answer, require multiple retries, or simply miss the mark — burning more tokens (and time) than starting with a stronger model.
Mid Models
Price range: $2 - $5/M in, $10 - $25/M out | Speed: Fast | Best for: Code generation, document analysis, multi-step reasoning, research synthesis — the bulk of knowledge-worker tasks.
Mid models are the sweet spot for most agent work. They're capable enough to handle complex instructions reliably, but cheap enough that you don't think twice about running them. On benchmarks like MATH (math reasoning), GPQA (graduate-level science), and SWE-bench (software engineering), mid-tier models score 60-80% — good enough for the vast majority of real-world tasks.
Complex Reasoning Models
Price range: $1.40 - $25/M in, $4.40 - $125/M out | Speed: Moderate | Best for: Novel research, hard math, architectural decisions, ambiguous problems where the model needs to work through uncertainty.
These models top the leaderboards — 85-95% on MATH, 70-80% on GPQA. They catch edge cases a mid model would miss, write tighter code, and navigate ambiguity without going off track. But that power comes at a cost: 2-5x the price of a mid model (more if you pick the expensive end of the range). Use them only when the task genuinely demands it.
The key insight: A flash model that takes 5 extra turns to solve a problem is no longer cheap — it's burning 5x the output tokens and eating 5x the wall-clock time. When choosing a model for an agent task, consider not just the per-token price but the expected number of iterations. A complex model that nails it in one pass is often cheaper and faster than a flash model fumbling through three.
How Token Pricing Works
Almost every AI model charges by the token. A token is roughly 0.75 words. "Hello world" is about 2 tokens. This paragraph is about 50 tokens. Think of tokens as the currency the model uses to measure how much work it's doing.
Every interaction has two costs:
- Input tokens — the prompt you send, plus any context or files you include. These are cheaper.
- Output tokens — the response the model generates. These are typically 3-4x more expensive than input tokens.
When an agent works on a task, it doesn't make one call — it makes many. It reads a file (input), writes code (output), runs it (input from results), fixes a bug (output), and so on. Each step in that loop is a separate API call, each with its own input and output tokens.
Here are representative prices for common models (check current pricing — these change):
| Tier | Model | Input (per 1M) | Output (per 1M) | Cost per hour |
|---|---|---|---|---|
| Flash | DeepSeek V4 Flash | $0.09 | $0.18 | ~$0.02 - $0.10 |
| Flash | GPT-4o-mini | $0.15 | $0.60 | ~$0.50 - $2 |
| Flash | Claude Haiku | $0.25 | $1.25 | ~$1 - $4 |
| Mid | DeepSeek V4 Flash (extended reasoning) | $0.09 | $0.18 | ~$0.02 - $0.10 |
| Mid | Claude Sonnet | $3.00 | $15.00 | ~$5 - $20 |
| Mid | GPT-4o | $5.00 | $15.00 | ~$5 - $25 |
| Complex | GLM 5.2 via Z Code | $1.40 | $4.40 | ~$5 - $30 |
| Complex | Opus 4.8 on OpenRouter | $5.00 | $25.00 | ~$10 - $50 |
| Complex | o3 | $25.00 | $125.00 | ~$50 - $250 |
The "cost per hour" column assumes moderate agent activity — about 50 tool calls per hour with typical input/output sizes. Heavy tasks (analyzing large codebases, processing long documents) will cost more.
Note on non-US models: DeepSeek V4 Flash delivers comparable quality to Claude Sonnet for roughly 97% less — $0.09/M input vs $3.00/M. GLM 5.2 approximates Opus-class capability at roughly 72% less via Z Code ($1.40/$4.40 vs $5/$25 on OpenRouter). At $0.09/$0.18 per million tokens, DeepSeek is cheap enough that an entire 8-hour agent workday costs less than a coffee. Both work with any standard OpenAI-compatible API endpoint.
Subscription Models and Discounts
Per-token pricing is the default, but there are other ways to pay that can save you significant money — and a few traps to watch for.
Subscription Plans
Some providers offer monthly subscriptions that include a bucket of tokens or a flat rate for certain models. These can cut your costs by 30-50% if you're a regular user. The trade-off: subscriptions often restrict which agents you can use — a plan that works for simple chat may not cover the model you need for complex agent tasks. Read the fine print on which models and which harnesses are included before you commit.
Prime-Time Premiums
Some providers charge more during peak hours — and they may not call it a price increase. Instead, they burn through your subscription credits 2-3x faster during prime time. For example, GLM applies a prime-time multiplier from 6PM to 6AM PST (overnight in North America, daytime in China). A task that costs 100 credits at noon might cost 250 credits at 10PM. If you're running agents primarily during those hours, factor that into your effective rate — a "cheap" subscription can end up costing more than per-token pricing if most of your usage falls in the premium window.
Beta and Discounted Models
There are legitimate ways to access strong models for free or nearly free:
- Free beta models — Some providers offer their newest or experimental models at no cost during a beta period through platforms like Opencode Zen or OpenRouter. You can run serious agent work for free while the model is in preview.
- Harness-specific discounts — Certain harnesses negotiate discounted rates with providers. For example, GLM 5.2 through Z Code is significantly cheaper than through direct API access. If you're committed to a specific harness, check whether it has preferred pricing — the savings can be substantial.
- Caching discounts — As mentioned above, prompt caching can reduce your effective cost by 60-80% on some providers. OpenRouter and most major providers apply this automatically when you repeat context across requests.
The bottom line: don't assume the list price is what you'll actually pay. Between caching, beta access, and harness discounts, your effective rate can be dramatically lower — but prime-time premiums can push it the other way. Know your usage pattern before choosing a payment model.
Worked Examples: Model Comparison
Let's walk through three real scenarios and compare how different model tiers perform — not just on price, but on the total cost including extra turns and failures.
Example 1: Research Assistant
Task: Read a 20-page PDF, summarize it, and extract key action items.
| Tier | Model | Turns | Cost | Quality |
|---|---|---|---|---|
| Flash | DeepSeek V4 Flash | 1–2 | ~$0.003 | Good summary, may miss nuanced action items |
| Mid | Claude Sonnet | 1 | ~$0.10 | Strong summary, well-organized action items |
| Complex | GLM 5.2 | 1 | ~$0.30 | Deep analysis, catches implications the mid model misses |
Verdict: For a straightforward PDF summary, the flash model is sufficient 90% of the time at 1/30th the cost. The premium is only worth it for high-stakes documents (legal contracts, regulatory filings).
Example 2: Bug Fix Sprint
Task: Investigate and fix three bugs in an unfamiliar codebase. The agent reads files, identifies root causes, makes changes, runs tests, iterates.
| Tier | Model | Turns | Time | Cost | Result |
|---|---|---|---|---|---|
| Flash | DeepSeek V4 Flash | 6–10 | ~20 min | ~$0.02 | Fixes 2 of 3 bugs, third fix introduces a minor regression |
| Mid | Claude Sonnet | 4–6 | ~12 min | ~$1.10 | Fixes all 3, cleanly, with tests |
| Complex | GLM 5.2 | 3–4 | ~8 min | ~$0.80 | Fixes all 3 faster, catches a fourth latent issue |
Verdict: The flash model is tempting at $0.02, but it takes twice as many turns, misses one bug, and introduces a new problem — you're not saving money if you have to fix the fix. The complex model is actually cheaper than the mid model here because it uses fewer turns despite higher per-token cost. This is the key dynamic: a smarter model that finishes in fewer iterations can be the most economical choice overall.
Example 3: All-Day Automation
Task: An agent running 8 hours a day, processing customer support emails — categorizing them, generating draft responses, updating a CRM.
| Tier | Model | Turns per email | Daily cost | Notes |
|---|---|---|---|---|
| Flash | DeepSeek V4 Flash | 1–2 | ~$0.50 | Cheap enough that you stop thinking about cost. Occasionally misroutes a complex query to the wrong category. |
| Mid | Claude Sonnet | 1 | ~$8 | Reliable. Handles edge cases well. Cost is meaningful but trivial compared to a human doing the same work. |
| Complex | GLM 5.2 | 1 | ~$24 | Overkill for routine email triage. Only worth it if emails include high-stakes questions that need deep analysis. |
Verdict: For high-volume routine work, flash models dominate. At $0.50/day, you can run an email-processing agent continuously without budgeting. The mid model is still an easy choice at $8/day — a fraction of a human's hourly rate. The complex model is wastefully expensive for this use case unless the emails genuinely demand expert-level analysis.
The takeaway: Model selection isn't just about the price tag. A cheap model that needs 3x the iterations isn't cheap. An expensive model that nails it in one pass might be the bargain. Match the tier to the task complexity, and always factor in the expected number of turns — not just the per-token rate.
Subscription Pricing
Some agent harnesses offer subscription plans instead of per-token pricing. You pay a flat monthly fee for a certain amount of usage. These can be a better deal if you use agents heavily, but you need to read the fine print:
- Usage caps — "Unlimited" often means "unlimited within reasonable use." Check what happens if you exceed the cap (throttled, extra charges, or cut off?).
- Model access — Some subscriptions restrict you to specific models or speed tiers.
- Rate limits — You might be limited to a certain number of requests per minute, which affects how fast your agent can work.
A subscription makes sense when you're using agents daily for steady work. Per-token pricing is better for occasional use or experimentation. Most people start with per-token and switch to a subscription once they know their usage pattern.
Hidden Costs
Beyond the model itself, a few costs sneak up on new agent users:
- Context caching — Every time you restart an agent, it may re-read the same context files (your README, your project structure). Some providers charge for cached tokens at a reduced rate; others charge full price.
- Image inputs — If your agent processes screenshots or images, those cost significantly more than text tokens. A single image can cost 100-1000x what a text prompt costs.
- Tool call tokens — The model's internal reasoning about which tool to call and what arguments to pass generates tokens that you pay for, even though you never see them.
- Error retries — If the agent hits a rate limit or timeout and retries, those retry calls still cost tokens.
These hidden costs rarely break the budget, but they explain why your actual bill might be 20-30% higher than your rough estimate.
Your Takeaway — The Budget Estimator
Here's a simple formula to estimate your monthly agent cost:
Monthly cost = (Avg tokens per task x Tasks per day x 30) x Price per token
For most people doing light-to-moderate agent work with a mid-tier model, expect $20-$60 per month. That's less than most SaaS subscriptions, and the agent does work a human would take hours to do.