record_spend
Records a run's actual input and output token usage in a local per-task ledger, priced at the model's list rates.
Instructions
Record a run's actual token usage in the local per-task ledger.
Args: task_id: Caller-chosen identifier grouping one task's runs. model_id: Model the run used. input_tokens: Actual input tokens consumed. output_tokens: Actual output tokens consumed.
Returns the recorded entry, priced at the model's list rates.
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": {
"task_id": "<task_id>",
"model_id": "<model_id>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "record_spend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| model_id | Yes | ||
| input_tokens | Yes | ||
| output_tokens | Yes |