Guides

Why is my AI bill so high — where your tokens actually leak

Illustration: a meter ticking up while token-coins leak out of a prompt

A familiar panic: you open your AI usage dashboard and the total is twice what you expected. Requests look about the same, same app — where's the bill coming from? Good news: it's almost always one of three causes, and each is fixable. Let's go through them, most common first.

First, the principle that makes the rest click: you don't pay per "request," you pay per token — chunks of text, both in and out. Hold that in mind and the rest falls into place.

Cause 1. You pay for the whole context every time (the most common)

Here's the main trap. The model doesn't remember past messages on its own. To make a chatbot "remember" the conversation, your code sends the entire history with every new question — again and again. The dialog grows, and each next request costs more than the last, even though the question you asked was short.

Same trap with documents: you stuff a whole 40-page PDF into every request so "the model has context." Forty pages of tokens, on every single call.

How to check. Look at what actually goes into the request: is it the whole conversation or just the latest? The whole document or the relevant chunk?

How to fix. Trim the context: send only the last few messages or a short summary of the past, not the whole wall of text. For documents, pull only the relevant fragment into the request, not the entire file.

Cause 2. An expensive model where a cheap one would do

The second most common. A top model can cost tens of times more than a small one for the same tokens. And if you run everything through the flagship — including "extract a number from this line" or "add a comma" — you're overpaying for simple tasks at the price of hard ones.

How to check. Walk through your model calls and honestly ask each one: does this really need the smartest model, or would a simpler one do?

How to fix. Split the tasks. Heavy reasoning goes to the expensive model, routine to the cheap one. This often cuts the bill the most; more in the breakdown on how to cut AI costs. How to pick a model for a specific task instead of by leaderboard is separate.

Cause 3. Your code hammers the model in circles

The third cause is technical and the most galling, because the money vanishes for no benefit at all.

  • An unbounded loop. The AI wrote you code where a model call landed inside a loop with a botched exit — and it fires requests by the hundred.
  • No cache. The same questions get asked of the model over and over, even though the answer doesn't change.
  • Aggressive retries. On an error the code retries with no pause and no limit — doubling or tripling spend out of nowhere.

How to check. Look at the request count in the dashboard over a short window. A sharp spike out of nowhere is almost always a loop or retries.

How to fix. Put a fuse on the rate — how to add rate limiting, broken down step by step. Cache repeating answers with caching. And keep a spend ceiling in the provider's dashboard itself, if it has one — that's the last safety net.

General rule: watch tokens, not the number of requests. One "small" question with a giant context costs more than a hundred short ones. The bill grows where the volume of text grows, not where you hit Enter more.

How do I tell what I was actually charged for?

The provider's dashboard (usage / billing) usually shows input and output tokens. Compare the spike by date with what you changed in the code: did context grow? did you add a feature with frequent calls? The answer is almost always there.

Why did the bill grow if the request count is the same?

Because the requests themselves got pricier. Most likely the context ballooned — longer dialogs, more documents per call — or the model started producing longer answers. More tokens per request means a higher price at the same request count.

Are short prompts really cheaper?

Partly. It saves both input (your prompt + context) and output (the model's answer). But the input win is usually far bigger: trimming a long context gives more than shaving your question by a couple of words.

A high AI bill is almost never "an expensive technology" — it's a leak in one of three places. Find yours, and spend drops back to normal. And building an app that counts tokens from the start is easier alongside someone who explains things like a friend.

Learn vibe coding — don’t just read about it

Short story-lessons, an agent simulator and daily practice — in our mobile app. Free.

Open the app
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →