model_usage_record
MCP tools › Window and UI driver
Book the token counts a provider reported for one call: provider (registered), model, task (default default), input_tokens and output_tokens (0 to 10^9 each). The cost is computed once from the price in force (exact model, else *) in millionths of its currency, or stays unknown without a price; the record names the key as none or keychain:<host>:<port>, never the key. dry_run defaults to true and answers the record; dry_run=false needs the user-granted settings right and appends it to model-usage.jsonl in the user's settings folder (mode 0600, at most 20000 records, the oldest dropped).
| Capability | ui.model_usage_record |
|---|---|
| Area | Window and UI driver |
| Access | changes settings |
| Reaches | — |
| Rights | settings |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
providerrequired | string | The provider id. |
modelrequired | string | The model. |
task | string | The task (default default). |
input_tokensrequired | integer | Input tokens as the provider reported them (0 to 10^9).minimum 0 |
output_tokensrequired | integer | Output tokens as the provider reported them (0 to 10^9).minimum 0 |
dry_run | boolean | Only answer the computed cost (default true); false books it and needs the settings
right. |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project model_usage_record '{"provider":"<string>","model":"<string>","input_tokens":1,"output_tokens":1}'Input schema as JSON
{ "properties": { "provider": { "description": "The provider id.", "type": "string" }, "model": { "description": "The model.", "type": "string" }, "task": { "description": "The task (default `default`).", "type": [ "string", "null" ] }, "input_tokens": { "description": "Input tokens as the provider reported them (0 to 10^9).", "type": "integer", "minimum": 0 }, "output_tokens": { "description": "Output tokens as the provider reported them (0 to 10^9).", "type": "integer", "minimum": 0 }, "dry_run": { "description": "Only answer the computed cost (default true); false books it and needs the `settings`\nright.", "type": [ "boolean", "null" ] } }, "required": [ "provider", "model", "input_tokens", "output_tokens" ], "additionalProperties": false, "type": "object"}