Budgeting an always-on AI agent: what actually costs money

Updated 2026-11-19 · Tapix AI

An always-on agent rarely overspends because a token is expensive. It overspends because the loop multiplies: every step re-sends the system prompt, the task and everything already done, then bills the reply on top. The rate prices a step; the loop decides how many steps you pay for.

Quick answer: step count and context growth decide an agent's bill more than the per-token rate. A five-step loop that re-sends its own history costs several times a stateless loop, and retries multiply both. Set a step cap and a token cap before you shop for a rate.

Where an agent's money goes

Four lines, and they compound:

  1. Steps — each step is a full request, billed as input plus output.
  2. Context — every step carries the history of the steps before it.
  3. Retries — a failed attempt may generate nothing, but the retry re-sends the whole context.
  4. Model tier — a router, a planner and a summariser do not need the same model.

Monthly cost = Σ over steps (input × rate + output × rate) + retry overhead. A rate cut moves each term 20 or 30 percent; a step cap changes how many terms exist.

Step count beats unit price

A five-step task with 2,000 tokens of prompt per request, 400 output tokens per step and 1,000 tokens of new history each step costs 10,000 input and 2,000 output tokens stateless. With history accumulating it is 2+3+4+5+6 = 20,000 input for the same work — double, at an unchanged rate, with an unchanged answer.

Doubling the step budget doubles requests and more than doubles input, because each step grows. Ten steps of accumulating context is not twice a five-step agent, it is closer to three times.

Retries and failed requests

Billing on failure depends on what the request produced. A request that generated no token is cheap — at Tapix AI, failed requests are not billed; only generated tokens are charged. The expensive retry is the one that succeeds after a failure: it pays the accumulated context again, and the failed attempt bought nothing. A 20% retry rate on an accumulating loop is a 20% input increase per task, so retries belong in the budget model, not the incident log.

Context accumulation is the quiet multiplier

In a loop, turn twenty pays for turns one through nineteen as input. That is the request format: tool results, plans and prior messages all go back up on every call.

None of this costs quality if the agent can still retrieve what it dropped. If the state is removable, it was billed for nothing.

Caps and degradation you can enforce

A budget that lives in a dashboard is a report, not a limit. Four caps bound the bill:

Order matters. Degrade before you fail: smaller model, less retrieval, fewer tools, then a logged failure. A silent downgrade is worse than a visible error, because the error can be measured.

The four loop patterns, priced

Cost units with output at 5× input, per 1,000 tasks, so the ratios hold at any dollar rate. Token counts are illustrative.

Loop patternInput tokensOutput tokensCost units (input + 5 × output)Multiple of one callWhat fixes it
Single call, no loop2M0.4M41.0×nothing to fix
Five steps, context reset each step10M2M205.0×step cap
Five steps, context accumulating20M2M307.5×summarise between steps
Accumulating plus 20% retries24M2M348.5×retry budget, idempotent tools

Row three costs 50% more than row two for the same steps and replies; only the context policy differs. Row four is a retry storm before anyone notices.

How to budget before you ship

Four steps, before the agent sees production traffic.

  1. Log usage per step, not per task. Averages hide the tasks that ran forty steps.
  2. Measure steps per task on 50 real tasks. Budget on the 95th percentile, not the mean.
  3. Build the cost-unit model from observed tokens, then multiply by tasks per month.
  4. Set caps near twice the observed p95 and alert at the caps, not after them.

Re-run it when the prompt changes: a longer system prompt raises the floor of every step, which is how agent bills creep.

Where Tapix AI fits

Tapix AI is a gateway, not a model vendor: one OpenAI-compatible endpoint, priced below the list price, billed per token from prepaid credit, no monthly fee, failed requests not billed. The prepaid balance doubles as the hard ceiling, and the model ladder is a string change. It lowers the rate; it does not shrink the loop.

FAQ

Q: Do failed or retried agent steps cost money?

A request that generates no tokens is not billed at Tapix AI. The retry cost is the successful attempt that follows, paying the accumulated context again; a retry storm shows up as input tokens, not an error line.

Q: Why does my agent bill grow faster than my task count?

Context accumulation. Input scales with loop length squared, so more tasks at more steps each compounds. Check steps per task before rates.

Q: Should I cap max_tokens or max steps first?

Steps. A step cap bounds input, output and retry exposure at once; a token cap bounds one step while the loop keeps going.

Q: Is switching to a cheaper model the right fix?

It is the last lever. A tier ladder suits cheap subtasks; moving the whole loop to a small model usually costs more in retries and extra steps than it saves.

Q: How do I keep an always-on agent's spend predictable?

Prepaid credit plus caps. The balance is the ceiling, so a runaway loop cannot produce an invoice you did not choose, and caps stop it burning the balance in an hour.

The short version

Cap the steps, shrink the context between steps, keep scratch state out of the prompt, and put the cheap model on the cheap subtasks. Then worry about the per-token rate.

See the actual per-model prices. The price page lists the vendor's official price next to ours, row by row, for every model in the live catalog. Open the price list

Related reading

Last updated: 2026-11-21最后更新:2026-11-21