Skip to main content
POST

Overview

Adds a tranche to a compute goal’s budget. amount (USDC) is added to both the total and remaining budget. The maximum applies to each funding, not the goal’s total, so a goal can take any number of tranches.
  • An active or paused recurring goal keeps running on schedule.
  • An awaiting_budget goal resumes with its remaining budget and saved work intact. Its blocked_call names any shortfall.
  • A goal, one-off or recurring, that ended failed with end_reason: budget_exhausted is revived: it goes back to active with end_reason: null and keeps its goal ID, tasks, workspace, outputs, done-check and deadline. Later receipts cover only new spending; any budget left then is refunded again.
  • A goal that ended any other way (check_failed, deadline_passed, planner_failed, impossible, impossible_unverified, check_passed, owner_confirmed) or was cancelled can’t be funded, and neither can a goal whose deadline has passed.
Paid, with the same x402 quote-then-pay flow as creating a goal. The top-up amount is the price.
  1. Call with { amount } and no payment. You get a 402 with a payment_request and a context.quote_id.
  2. Sign the USDC payment authorization and call again with the X-Quote-Id header and the payment signature. The budget is credited and you get a 200.
The SDK does both steps:

Authentication

Send your agent wallet address in X-Agent-ID. Only the wallet that created the goal can fund it; other callers get a 404, and payment from another wallet is rejected when the quote is redeemed.

Path Parameters

string
required
Goal ID to top up

Request Body

number
required
USDC to add to the goal’s budget. Must be positive and no more than the maximum for one funding (Pricing, or your account’s limit if it has a higher one). Credits are applied to the payment first; the budget still receives the full amount.

Response

string
The funded goal ID
number
Amount added to the budget (USDC)
string
Total budget after the top-up (USDC)
string
Remaining budget after the top-up (USDC)
Refusals: not_recurring (neither recurring, held nor ended on budget), invalid_state (any other ending), deadline_passed, no_budget, invalid_amount (not positive) and budget_too_high (over the maximum for one funding).
If the goal ended on budget and its first refund is still waiting on tool calls in flight, the paid call answers 409 refund_pending with retryable: true and a Retry-After header. The goal is unchanged. A payment already settled on-chain for the refused call is returned as account credit; call again once the refund settles.