API Relay Bill and Cache Reconciler
bill_reconcileSend your own usage rows and the prices the relay posts; no relay key is needed. Recomputes every row in integers, flags rows charged above the posted price, and names the cause where the arithmetic can: cache reads billed as full input, a whole-number multiplier, or billing from the official price times a hidden multiplier. Up to 10,000 rows per call.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "bill_reconcile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Your usage rows, up to 10000: { id?, model, input_tokens, output_tokens, cache_read_tokens?, cache_write_tokens?, charged }. charged is a decimal string in the relay's billing currency. | |
| posted_prices | No | Prices the relay posts, per 1M tokens, as decimal strings: { "<model>": { input, output, cache_read?, cache_write? } }. | |
| tolerance_pct | No | Rows charged more than this percent above expected are flagged (default 2). | |
| include_all_rows | No | Also return rows that passed. | |
| reference_prices | No | Optional official prices in the same shape; lets an overcharge be explained as "official price x N". | |
| posted_multiplier | No | The group multiplier the relay posts, e.g. "0.5" (default 1). | |
| input_includes_cache | No | Required when rows have cache tokens: true if input_tokens already counts cached tokens (OpenAI-style), false if not (Anthropic-style). |