Overview
Formal estimates the cost of every LLM request from token prices you set. Each log carries the cost, and policies read it. Policies also see what each user has spent, so you can enforce budgets. All amounts are in USD.Steps
1. Set Token Prices
Open Token Pricing in the Control Plane.- Set a provider default to price every model of that provider.
- Click Add model price to price one model. A model price overrides the provider default.
- Add aliases for names the model is requested under, such as
opus-4.1in Cursor.
cost_usd.
2. Add Advanced Prices
Expand Advanced pricing in the price dialog. Each empty field falls back to the base price.3. Enforce Budgets
Request rules read spend ininput.llm. See LLM resources for every field.
Spend refreshes every few minutes, so a burst of requests can exceed a budget slightly. A field is absent when nothing was spent, so read it with
object.get.
The following policy blocks a user’s requests after $50 in a day or $500 in a month:
4. Block Unpriced Models
priced is false when no price matches the request. price_source is model, provider_default, or none.
The following policy blocks models without a model price, so new models need a price before use:
not input.llm.priced instead to accept provider defaults.
Troubleshooting
Cost is missing from logs
Cost is missing from logs
Cause: no model price or provider default matches the request. Fix: price the model from Seen in logs without a model price.
A budget policy never triggers
A budget policy never triggers
Cause: the policy reads the spend field directly, and it is absent before any spend. Fix: read it with
object.get(input.llm, "user_spend_usd_daily", 0).Next Steps
AI Usage
See which models and clients people use
Policy Evaluation
Every field LLM policies can read