AI CodeOps

Cost controls

Cap AI spend in AI CodeOps with a workspace budget and per-workflow caps, see cost per session and per step, and read the Usage page's allowance and charts.

AI CodeOps records the cost of every model call, rolls it up per session, and lets you cap what a workspace can spend. Budgets apply to every session, whether it runs on the platform's models, on credits, or on your own provider key.

Workspace budget

Open Configure → Billing and find Cost budget. With no budget set, the page says "No budget configured. Workflow dispatch is currently unmetered." Choose Configure budget:

FieldWhat it does
PeriodDaily, Weekly, Monthly (default) or Rolling 30d. Periods start in UTC; weeks start on Monday.
Soft limit (USD)A marker on the spend bar. Past it, starting a session in the console shows a warning with the period's spend, and the crossing is recorded under Recent decisions on Secure → Policies. Sessions keep running, and no email or notification is sent.
Hard limit (USD)New sessions are refused, and running sessions stop, once spend reaches it.

The soft limit must not be higher than the hard limit. A budget can be disabled without deleting it.

The panel shows This period spend against the hard limit: amber from 70%, red from 90%.

Owners, admins and billing admins can set budgets. Creating the budget, changing its limits and turning enforcement on or off are recorded in the audit log as budget.updated.

Per-workflow caps

After the budget exists, choose Edit limits to set Per-workflow caps (USD): an optional hard cap for each workflow, on top of the workspace limit. Use it to keep an expensive workflow, such as Feature SDLC, within its own limit while quicker ones run freely.

There are no per-agent budgets.

What happens at the limit

  • Starting a session: "Over budget — … Raise the workspace budget before launching."
  • During a session: the budget is checked before every model call. A session that crosses the limit stops with "Stopped over budget" and the status Blocked by budget.
  • If the check itself fails when a session starts, the session is blocked rather than run unmetered. If it fails during a session, the session keeps running.

A single model call already in flight can take spend slightly past the limit.

Cost per session

  • Develop → AI Sessions lists the 20 most recent sessions with their Cost.
  • A session's page shows its total cost, and a table of each agent step with its runtime, status, duration, cost and tokens.
  • Develop → Changes shows the cost of each change: what the session that proposed it spent.

Tokens from failed model calls are counted too, because the provider charges for them.

The Usage page

Measure → Usage has three parts:

  • AI allowance this month: a bar per tier of the platform's models, and when the allowance resets. See Models and tiers.
  • Cost: daily spend by model for the month, filterable by model and API key. Owners, admins, DevOps admins and billing admins can see it.
  • Usage History: each model call with its date, model, input and output tokens, cost and session.

Credits and spending limits

On the Billing page, workspaces with billing set up can add credits, turn on Auto Reload, and set a Monthly Limit for credit spend. A session that runs out of credits stops with "Stopped: the workspace's credits ran out."

Next steps

Frequently asked questions

Can I set a budget per agent?

No. Budgets are per workspace and per workflow. The cost of each agent step is shown on the session's page, so you can see where the money went.

Does a soft limit stop sessions?

No. Past the soft limit, sessions still start, with a warning that shows the period's spend. Crossing it is also recorded on the Policies page. No email or notification is sent. The hard limit and per-workflow caps stop sessions.

Was this page helpful?