Home / Blog / How AI Pricing Works
AI & Agents · Deep DiveHow AI Pricing Really Works (and How Not to Blow Your Budget)
AI bills feel mysterious until you learn the one unit everything is priced in: the token. Here's how token billing works, why output costs more, and the levers that keep your spend from spiraling.
Key takeaways
- AI is billed by the token — roughly four characters of text. Your cost is essentially tokens × price.
- Output usually costs more than input. Verbose responses are where bills quietly balloon.
- A big context window doesn't cost money by itself, but stuffing it on every call does — you pay for those input tokens every single time.
- Estimate before you build with tokens per request × price × number of requests, then pull the cost levers: smaller models, caching, trimming context, capping retries.
Pricing for AI looks baffling until you realize the entire system rests on a single unit, and once you can see that unit, every confusing invoice suddenly makes sense. The unit is the token, and almost everything about controlling your AI budget comes down to understanding how tokens are counted and where they pile up.
If you've ever stared at an AI bill that was triple what you expected, or hesitated to ship a feature because you couldn't predict what it would cost, this is the piece for you. We won't quote specific per-token prices — those change constantly — but we'll give you the method, which doesn't.
Tokens: the unit of billing
A token is a chunk of text, a little smaller than a word. A useful rule of thumb is that one token is about four characters of English, so roughly a hundred tokens is about seventy-five words. Models read and write in tokens, and that's also how they bill.
Crucially, you're charged for both directions: the tokens you send in (your prompt, instructions, and any pasted context) and the tokens the model sends back (its response). Add them up, multiply by the price per token, and that's your cost for the call. There's no hidden complexity beneath that — just a lot of multiplication happening at scale. If the idea of a token still feels fuzzy, we unpack it further in tokens, explained.
Input vs. output pricing
Here's the wrinkle that catches people: input and output tokens usually aren't priced the same. Generating text takes more computation than reading it, so output tokens typically cost more than input tokens — often by a meaningful multiple.
The practical takeaway is direct: a chatty, rambling model is an expensive one. Asking for concise answers, or for structured data instead of prose paragraphs, isn't just cleaner — it's cheaper. When output is your costly side, every unnecessary sentence the model writes is money.
The context-window trap
The context window is the maximum amount of text a model can hold in mind at once. Bigger windows sound like a free upgrade — paste in the whole manual! — but here's the catch: you pay for every input token you put in the window, on every call.
So if you paste a 10,000-token document into the context on each request, you're buying those 10,000 input tokens again and again. In a one-off that's harmless. Inside an agent loop that runs the same call dozens of times, it's how a small feature turns into a large invoice. The window's size isn't the bill; what you choose to fill it with is. We dig into this dynamic in context windows, explained.
You don't pay for how big the context window is. You pay for how much you stuff into it — every single time you call.
Per-token API pricing vs. flat subscriptions
Not every AI tool bills by the token directly. There are two broad models, and they suit different situations:
- Per-token API pricing. You pay for exactly what you use. Predictable per call, but it scales with volume — great for building products, dangerous if a loop runs wild.
- Flat subscription tools. A fixed monthly fee for a consumer app or seat. Predictable for budgeting, but you don't control the underlying token economics, and heavy use may hit limits.
For a person doing daily tasks, a subscription is usually simplest. For anything you're building — an agent, a feature, an automation — you'll almost always be on per-token API pricing, which is exactly why estimating tokens matters so much.
A worked cost estimate (the formula, not the prices)
You can sanity-check any AI feature with one formula:
cost ≈ (input tokens × input price) + (output tokens × output price), × requests
Work it in plain steps:
- Estimate the average input tokens for a typical request (your instructions plus any context).
- Estimate the average output tokens (how long a typical answer is).
- Multiply each by its per-token price and add them — that's the cost of one request.
- Multiply by your expected requests per day or month.
Plug in whatever current prices your provider lists. Even a back-of-the-envelope version tells you whether a feature costs cents or hundreds of dollars a month — before you write a line of code. The mistake is never running the numbers at all.
Concrete ways to control spend
Once you see the formula, the levers are obvious — each one attacks a term in the equation. Here's how they compare:
| Cost lever | How it helps | Best for |
|---|---|---|
| Use a smaller model for easy tasks | Lowers the per-token price; reserve the big model for hard work. | Classification, routing, simple extraction. |
| Cache repeated input | Stops you re-paying for the same context on every call. | Fixed instructions or documents reused across requests. |
| Trim the context | Cuts input tokens by sending only what's needed. | Long histories, full documents, bloated prompts. |
| Ask for concise / structured output | Cuts the pricier output tokens. | Any response that tends to ramble. |
| Cap retries and steps | Limits how many times a loop can multiply your cost. | Agents and any automated loop. |
The single highest-leverage move for most teams is matching the model to the task — not running the biggest, most expensive model on jobs a small one handles fine. That idea is worth its own piece, which is why we wrote AI model routing for cost control.
Where people go wrong (and when to call a pro)
The budget disasters we see rarely come from one expensive call. They come from structure.
If you're putting AI into a product where the bill scales with your users, getting the cost architecture right early is worth far more than it sounds. That's exactly what we plan for in our development services.
Frequently asked questions
What is a token in AI pricing?
Why does output cost more than input in AI pricing?
Does a bigger context window cost more money?
How can I estimate my AI costs before building?
Worried about what AI will cost you?
We'll architect it to be cheap before it's expensive.
Ghostwire Systems builds AI features with cost in mind from the first sketch — model routing, caching, and sane limits baked in. Tell us what you want to build and we'll estimate it honestly.