Someone just asked an AI to write 12 lines of code and watched it burn $78,000. That story, an OpenAI coding agent that ran up the bill without authorization, hit the front page of Hacker News this weekend. It’s an extreme case of a normal problem: almost nobody can estimate the real AI agent cost before the invoice arrives.
Why the AI agent cost surprises everyone
A chatbot answers once. An agent loops. It plans, calls a tool, reads the result, adjusts, calls another tool, and repeats until the task finishes. Every single turn sends tokens to the model, and you pay for every turn.
Think of it like a taximeter that keeps running at every red light. A research agent that works in 10 turns, reading about 2,000 tokens of context and writing 500 per turn, burns roughly 20,000 input tokens and 5,000 output tokens per task. That’s the hidden multiplication beginners miss when they price an agent from a single conversation screenshot.
The loop isn’t the only meter running. Hosted tools bill separately, so web search calls, file searches, and code interpreter time each add their own fees on top of the tokens. Skip this part and your spreadsheet lies to you.
The price list that decides everything
Here’s where the AI agent cost becomes a money decision. OpenAI’s API prices, per million tokens in and out, currently look like this:
| Model | Input / 1M | Output / 1M | Best for |
|---|---|---|---|
| GPT-5.6 Sol (flagship) | $5 | $30 | Hard agentic work, coding |
| GPT-5.6 Terra | $2 | $12 | Everyday production tasks |
| GPT-5.6 Luna | $0.20 | $1.20 | High-volume simple steps |
Same agent, same workload, 25x price difference between the flagship and the small model. Now the worked example. Your research agent runs 100 tasks a day. On Sol that costs about $0.25 per task, which lands near $750 a month. Switch the same loop to Luna and the identical work costs roughly $30 a month.
That’s not a rounding error. That’s the difference between an automation that pays for itself and one you shut down in February. A fresh calculator from BroutonLab does this math for your own numbers, comparing raw API tokens against a SaaS subscription, and it’s worth five minutes before you commit to anything.
When a subscription beats the API
Raw tokens aren’t the only way to pay. ChatGPT’s subscription bundles a chatbot, an agent mode, and generous task limits for about $20 a month. If you run a few tasks a day for yourself, the flat rate wins almost every time, and you skip the meter anxiety entirely.
The API wins in other cases. You need automation inside your own app, custom tools the subscription doesn’t offer, or scheduled jobs running hundreds of tasks for customers. At that volume, per-token pricing with the right model beats any flat fee.
So here’s the honest decision rule. Under roughly 30 tasks a day for personal use, stay on the subscription. Past that, or when software has to call the model directly, go API, but pick the cheapest model that survives your quality test. Either way, the AI agent cost always comes down to volume multiplied by model choice.
Four ways to cut the bill without cutting quality
- Stop using the flagship for everything. Route simple steps like summarizing a page or formatting output to Luna or Terra. Save Sol for the hard reasoning steps. Most stacks mix two models and cut bills by more than half.
- Turn on caching. Repeated context, like your long system prompt, bills at about 10% of the normal input rate when cached. One setting, and the most repetitive part of your bill shrinks 90%.
- Use Batch mode. Half price for any job that can wait a few hours. Overnight reports and scheduled digests don’t need real-time pricing.
- Set a hard spending cap. Every API dashboard has a monthly limit. Set it the day you create the key. The $78,000 story happened partly because nothing stopped the loop.
Watch the trap doors too. Context that grows past the standard window can bill at roughly double the rate, and “fast” processing tiers charge about 2x for speed you probably don’t need on batch jobs.
If you’d rather skip token math completely, some tools package the agent for you at a flat rate. We’ve seen this with the coding agent that promises up to 40% lower costs than doing it yourself, and with Jev, a model built to cut automation costs by choosing cheaper processing paths automatically. The Jev approach fits this article perfectly: it skips expensive text generation for routine decisions, which is exactly the kind of cost thinking that keeps agents affordable.
Does this apply to Claude and Gemini?
Yes, because the loop math is universal. Anthropic’s Claude API currently spans roughly $1 to $25 per million tokens depending on the tier, and Google prices its small Flash models aggressively for high-volume work. Whichever lab you pick, the stack order stays the same: cheap model for routine turns, strong model for the hard reasoning, caching on, batch anything that can wait. The vendors change, the AI agent cost equation doesn’t.
Your first week, budgeted
Start with the $20 subscription and run your idea manually for seven days. Count the tasks, note the turns each one takes. Multiply. If the monthly math lands under $30 of equivalent usage, you’ve saved money and learned your workload. If it lands in the hundreds, now open the API, pick Terra as your default, cache aggressively, cap your spend, and put Luna on the simple steps.
Chip prices and model rates keep falling, so revisit your math quarterly. OpenAI cut its small model’s price by 80% in a single update this summer, and similar moves keep coming as competition between labs heats up.
Takeaway
The real AI agent cost is loop turns times model price, plus tool fees, and it swings 25x depending on the model you pick. Estimate before you build, cap whatever you run, and let the cheap models carry the routine work. Do that, and you get the automation without the invoice story.
Sources: BroutonLab agent cost calculator, OpenAI Agents API pricing breakdown, OpenAI price-cut coverage