set_ai_budget
Set an app's monthly AI gateway token limit to cap prompt and completion tokens across all aliases. Use it to enforce usage budgets on apps you own.
Instructions
Set an app's monthly AI gateway token limit.
A submitter may only set a value at or below the limit in force (the
app's own, else the machine default) on apps it owns: raising or
removing a limit is for an admin or the console, 403
``ai_budget.raise_forbidden``. Not a spending guarantee: a
``provider = "api"`` binding or a key in a variable never crosses the
gateway. Refusals: 404 ``service.not_found``, 403 ``forbidden`` (not
your app).
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": {
"service": "<service>",
"tokens_month": "<tokens_month>"
},
"name": "set_ai_budget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | The app to limit. | |
| tokens_month | Yes | Prompt + completion tokens per UTC month, every alias of the app summed. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |