set_thread_budget
Replaces a thread's entire budget envelope—tokens, cost, turns, and wall-clock time—requiring all limits so an omitted cap cannot leave a run unbounded.
Instructions
REPLACE a thread's whole budget envelope. Every dimension must be stated — max_tokens, max_usd_micros ($1 = 1000000), max_turns, max_wall_secs — and null means no cap on that dimension. Omitting one is an error rather than a silent removal, because a removed cap never binds and the run it should have stopped keeps going. Use update_thread_budget to change some dimensions and leave the rest alone. An unrecognized key is rejected rather than ignored. Accumulated usage is preserved. When a dimension is exceeded, report_usage stops the run.
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": {
"thread_id": "<thread_id>",
"max_tokens": "<max_tokens>",
"max_usd_micros": "<max_usd_micros>",
"max_turns": "<max_turns>",
"max_wall_secs": "<max_wall_secs>"
},
"name": "set_thread_budget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_turns | Yes | ||
| thread_id | Yes | ||
| max_tokens | Yes | ||
| max_wall_secs | Yes | wall-clock budget vs the working clock | |
| max_usd_micros | Yes | USD in micros ($1 = 1000000) |