Re-rate past usage
rerate_usageStaff only. Re-prices one consumer's, or one account's, past calls, messages, data, AI, and number or service fees for a date range, and compares them with what was charged. pricing_mode today uses the prices configured now, including a fee that was removed or set to zero. pricing_mode as_was uses the prices in effect at each usage time. pricing_mode is required except when rolling back. Omit apply to save the report without posting adjustments. Apply posts a wallet adjustment per usage item only when confirm is true and report_id is the id from that dry run. Credits an over-charge. Debits an under-charge only when debit_undercharge is true. rollback undoes those adjustments for the same report id.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"date_from": "<date_from>",
"date_to": "<date_to>"
},
"name": "rerate_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | Post the adjustments. Requires confirm and report_id. | |
| confirm | No | Required with apply or rollback. Omitted returns the dry-run report. | |
| date_to | Yes | Range end, inclusive. | |
| rollback | No | Reverse adjustments posted for this report. | |
| date_from | Yes | Range start, YYYY-MM-DD or ISO timestamp. | |
| report_id | No | report_id from the saved dry run. | |
| account_id | No | Account whose consumers are re-rated. | |
| consumer_id | No | Consumer whose usage is re-rated. | |
| pricing_mode | No | today prices at the current rates. as_was prices at the rates in effect at each usage time. Required except for rollback. | |
| application_id | No | application_id from apply, used to roll back. | |
| debit_undercharge | No | When apply is true, also debit usage that was under-charged. |