Set a session's budget
Sets a root session tree’s budget and returns it. The budget must be more than the tree has already spent and no more than the multiagent.limits.max_tree_cost_usd of the agent version the session runs, unless a move to a version with a higher cap is pending: then it may reach that version’s cap, and the tree is still held to the applied cap until the move applies. A thread or grader returns 400 naming its root. Work paused at the old budget continues as soon as the budget is saved: the service sends the root a short message saying the budget changed, through the same admission as any message, so a tenant that is out of credit returns 403 session_start_not_admitted and the work stays paused under its new budget; repeating the request once the refusal is resolved continues it. Once the message is delivered, repeating the request sends nothing, so a retry never starts another turn. A finished tree is not restarted, except a root that ended at its agent’s cap, which a raise past that cap toward a pending move’s version continues; a session bound to a Slack thread (continuesOnRaise false) continues on its next reply there. Returns 400 where session budgets are not available to the caller.
Authorizations
Headers
Replay-protection key in an organization-wide namespace shared by keyed mutations. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.
1 - 256^[!-~]+$Path Parameters
Body
The spend at which a session and its threads pause, in US dollars at the billed price, counting model requests, tools and sandbox compute. On Recursion, linked outcome grading sessions count toward the writer's budget when they share that budget. Reaching it pauses the session with stop_reason budget_reached before its next paid request, but requests already running finish and can pass it. Raising or removing it continues the session, except one bound to a Slack thread, which continues on its next reply there.
Response
A session tree's budget and what it has spent toward it.
A session tree's budget and what it has spent toward it.
Whether raising or removing the budget of a session paused at it continues the session right away. False for a session bound to a Slack thread, which continues on its next reply there, and for a session that ended at its budget after spending its agent's cap with no move to a version with a higher cap pending, which no raise can continue.
The multiagent.limits.max_tree_cost_usd of the agent version the session runs, in US dollars with two decimals: the most the tree may spend, and the most this budget can be set to unless a move to a version with a higher cap is pending. With such a move pending the budget may be raised up to that version's cap, and maxCostUsd can then read above agentCapUsd; the tree is still held to agentCapUsd until the move applies.
"25.00"
For a session that ended at its agent's cap while a move to a version with a higher cap is pending: that version's multiagent.limits.max_tree_cost_usd, in US dollars with two decimals, the most a raise that continues the session may set. Absent otherwise, and when that version declares no cap.
What the session tree has spent, plus any linked outcome grading sessions charged to the same budget on Recursion, in US dollars with two decimals, at the billed price the budget is enforced at (models, tools and sandbox compute). Present on a full read of the root; absent when the spend could not be read. A session that paused at its budget can read a little past it: the request that crossed it completes.
"4.20"