Price a Call Before You Make It
ledger_priceWhat will this call cost? Priced from the same table the caps use.
Exists because ledger_track requires the CALLER to supply amount_cents, so an agent whose spend is capped could under-report its own cost and stay under the cap. This returns the number the enforcement path would use, so an agent can report honestly (and plan before it spends).
Cost = (tokens_in * in_rate + tokens_out * out_rate) / 1_000_000. If the model has cache rates, the standard in-rate is used, which is the conservative direction for a spend cap.
Every price carries the source it came from and the date it was read, and
verified: false means the number was NOT read off the provider's own
pricing page. Treat an unverified price as an estimate, not a measurement.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | the model id you are about to call (e.g. gpt-4o, claude-sonnet-4) | |
| tokens_in | No | expected input tokens | |
| tokens_out | No | expected output tokens, e.g. your max_tokens |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||