Jump straight to the numbers

← All articles

Your Agent Framework Burns $40 a Month Quietly

01 / The receipt line that hurts: tokens you never see

Beginners ask one question when picking an agent framework: which one is free to install. The better question is what lands on the bill at the end of the week. Nearly every framework costs nothing to download and a lot to run, because every planning step, every tool call, and every polite retry is paid in tokens. On CheapRelay you pay per real token, including cache reads and writes, with no monthly fee and no subscription, so the receipt itself is honest. Honest billing still shows you costs you never planned for. In my first month with one small automation I set a mental ceiling of five dollars and the token meter drifted to about forty dollars by day twenty four. Nothing was broken. The framework was doing exactly what its defaults told it to do: resend the whole conversation on every call, keep full history forever, and retry after failures.

Open a real receipt and you usually find four cost lines, not one. Here is what a beginner actually pays for on a typical day of agent work.

  • ■ Input tokens, which include the system prompt, the tool definitions, and the entire conversation history sent again on every single turn.
  • ■ Output tokens, the part beginners think about, which are often the smallest line on the bill.
  • ■ Cache writes, charged when a prompt prefix is stored for the first time, and cache reads, charged each time that prefix is reused.
  • ■ Retry tokens, the cost of the same request being sent again because a tool returned malformed JSON or a timeout hit.

Once you see those four lines, the mystery disappears. The framework is not secretly draining your account. It is quietly multiplying the number of tokens you send, over and over, in ways no quick tutorial mentions.

02 / Retries and failed tool calls double your bill without warning

The single biggest surprise for a beginner is that a failed run is not free. If an agent tries to call a tool and the tool throws an error, the framework usually retries. Many frameworks retry three to five times per step by default, and each retry re-sends the full context. Multiply one failed step by five retries and you have paid for six attempts instead of one. Now imagine a chain of ten steps with a failing tool in the middle: the cheap part of that run becomes the expensive part.

There is a second multiplier hiding here. Most agent frameworks pass a tool schema into every request so the model knows what it can call. With ten tools and verbose JSON schemas, that can be two to four thousand tokens of instruction that rides along on every turn. It feels free because you typed it once. The meter counts it every time.

Concrete fixes cost nothing and save real money. Set a retry cap of two instead of leaving the default. Validate tool arguments before sending them to a service that might charge for a bad call. Trim tool descriptions to one short sentence each instead of three paragraphs. And put your stable instructions, role definition, and tool schemas at the very front of the prompt so they form a reusable cache prefix. On a pay-per-token relay that includes cache billing, that ordering turns thousands of repeated input tokens into cheaper cache reads.

03 / Context growth turns a small chat into a five million token bill

Agents do not start expensive. They become expensive. A conversation grows by a few thousand tokens per turn, but the framework resends the whole history each time. The cumulative total grows much faster than the chat feels.

Run the arithmetic on a simple example. A fifty turn session where each exchange adds about four thousand tokens looks modest. But the first turn sends four thousand tokens of input, the second sends eight thousand, the third twelve thousand, and so on. By turn fifty you are sending two hundred thousand tokens in one request, and the total input across the session is four thousand multiplied by the sum of one to fifty, which is 4,000 x 1,275, or roughly 5.1 million tokens. The output was maybe fifty thousand tokens in total. The input line, which nobody watches, dominates the receipt by a factor of a hundred.

This is why context management is a budget feature and not an engineering hobby. Keep a rolling window instead of infinite history. Summarize older turns into a few sentences and discard the originals. Move raw tool output into a file or a database and leave only a short pointer in the prompt. Drop anything a model does not need to reason about the current step. If your framework offers automatic compaction, turn it on early, before the context has bloated, not after.

04 / Subagents, parallel workers, and logging are priced like real work

Frameworks sell elegance. Agents bill for compute. The features that make an agent framework attractive are usually the ones that inflate the invoice, because each one multiplies requests rather than reducing them.

Subagent fan-out is the classic trap. A planner delegates to three subagents, each of which receives its own copy of the system prompt, its own tool schemas, and its own scratch history. Four conversations run where you thought one was running. Parallel workers do the same thing: four workers means roughly four times the context traffic, not four times the speed at the same cost. Long term memory and retrieval features add a second model call or an embedding call per turn. Verbose tracing and observability tools sometimes ship the full prompt to an external service, which is a cost and a privacy question at the same time.

None of this is bad engineering. It is simply priced work. Before enabling a feature, ask one question: does this add requests per turn? If it does, budget for it. A frugal beginner setup looks like this: one agent, no subagents until the task proves it needs them, a retry cap of two, a context window you manage yourself, and traces that record token counts instead of full prompts. That setup runs a full day of experiments for the price of a coffee, while the default configuration runs through a week of budget in one afternoon.

05 / A five dollar weekly budget that survives real experimentation

Here is a budget that works on a tiny wallet and still teaches you everything. Give yourself five dollars for the week, which is about twenty to twenty one dollars across a month, and split it into slots: two dollars for exploration, two dollars for the main project, and one dollar held back for debugging. When the slot is empty, stop. That single rule is worth more than any optimization, because it forces you to notice which runs are expensive before they compound.

Inside those slots, use the cheap tier of a model family for iteration and switch to a stronger model only for the final run. On the sale list, Claude Haiku 4.5 and Gemini 2.5 Flash are the sensible first choices for a beginner learning how prompts and tool calls actually behave. Write your prompt and test it with a ten turn conversation before you let an agent run fifty turns. Log input tokens, output tokens, cache reads, and cache writes per run in a simple spreadsheet. Two columns of numbers will tell you within a week whether context growth, retries, or output verbosity is your real cost driver.

Keep one API key for everything so the accounting stays simple. CheapRelay gives you one key that reaches Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok and more, with OpenAI-compatible routes under /v1 and Gemini native under /v1beta, so a script written today keeps working when you swap models tomorrow. It works with Claude Code, Codex, Gemini CLI and any OpenAI SDK, billing per real token with no monthly fee and no subscription. If you want to try it, sign up at CheapRelay and you can also earn a 20 percent reward on what invited users pay.

Hidden costs in agent frameworks are never truly hidden. They sit in the retry counter, in the context length, in the tool schema you pasted once, and in the subagents you enabled because they sounded professional. Read those four lines on the receipt, cap the multipliers, and a five dollar week becomes enough to learn the entire stack.

Sign up Try the prices yourself, sign-up credit included.

More reading

DateAisleWritten inTitle
2026-10-30Spend lessENTwo Receipts, 2 Million Tokens, $0.80 Saved
Two receipts for the same 2 million tokens: one bills input and output, the other caches. Same results, $0.80 cheaper per cycle.
2026-10-30Spend lessENTwo Chatbot Receipts: $0.03 and $0.31 per Resolved Ticket
Two support chatbot bills side by side, judged only on price per useful result, with the routing and caching math that cut spend.
2026-10-30Spend lessENSoftware 0 Cents, AI Capped at 40,000 Tokens
A beginner weekend plan for a receipt-sorting CLI: free tools, one API key, and a hard cap of 40,000 tokens.
2026-10-30Spend lessENTag 10,000 Feedback Lines for About $0.66
A beginner walkthrough: tag 10,000 feedback lines with a cheap model for roughly $0.66, plus batching, caching and a human review plan.
2026-10-30Spend lessENOne AI Request Costs $0.004: The Receipt Math
Estimate cost per user for an AI feature on a tiny budget: token counting, cache billing, a $20/month worked example, and a receipt line that proves it.
2026-10-30Spend lessEN50k tokens, one key, under $1: a fair price check
A beginner, tiny-budget walkthrough for comparing official list prices with relay prices using per-token math, cache lines and a real receipt.