AI coding agents are billed by the token, and agents use a lot of tokens. A planning step, a build step, a review, a test-fixing loop: each one calls a model, sometimes many times. One long session can cost more than a week of short ones, and most teams only find out when the invoice arrives.
Predictable AI spend comes down to three things: seeing the cost, limiting it, and knowing what happens at the limit.
1. See the cost of every session
You can't manage what you only see monthly. In AI CodeOps, every model call is recorded and rolled up:
- Per session: each session shows its total cost, plus a table of every agent step with its runtime, cost and tokens.
- Per change: each proposed change shows what the session that produced it spent.
- Per day and model: the Usage page charts daily spend by model, filterable by model and API key.
Tokens from failed model calls count too, because the provider charges for them. A cost view that skips failures will always look cheaper than the bill.
2. Set a budget that actually stops spend
A budget that only sends a warning is a report, not a limit. AI CodeOps budgets have two levels:
- Soft limit: a marker. Past it, starting a session shows a warning with the period's spend, and the crossing is recorded.
- Hard limit: new sessions are refused, and running sessions stop once spend reaches it.
Budgets can run daily, weekly, monthly or on a rolling 30 days. The budget is checked before every model call, so a runaway session stops close to the limit instead of at the end of the month.
3. Cap the expensive workflows separately
Not all work costs the same. A full feature workflow with planning, building, multiple reviews and tests costs much more than a quick fix. Per-workflow caps let you keep the expensive one within its own limit while quick ones run freely under the workspace budget.
Know what happens at the edges
Good controls are honest about their edges:
- If the budget check fails when a session starts, the session is blocked rather than run unmetered.
- A single model call already in flight can take spend slightly past the limit.
- Budgets apply whether a session runs on the platform's models, on credits, or on your own provider key.
Bring your own key, keep the same controls
Many teams want to use their own model provider account for billing or data reasons. That shouldn't mean giving up spend controls. Sessions on your own key show the same cost and respect the same budgets.
The takeaway
Ask your AI coding tool three questions. What did that session cost? What stops a session that's running away? Can I cap an expensive workflow separately? If the answers are "check the invoice", "nothing" and "no", the surprise is already scheduled.
AI CodeOps is free during the open beta: https://aicodeops.dev
Drafted with AI assistance and edited by the AI CodeOps team. Originally published on Medium.
