Skip to main content
POST

Overview

Adds budget to a compute goal. amount (USDC) is added to both the total and remaining budget.
  • An active or paused recurring goal keeps running on schedule.
  • 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. The receipt written when it ends again covers only what it spent since the first one; 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 budget (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)
The goal must be recurring or have ended on budget (else not_recurring), must not be completed, cancelled, or failed for any reason other than budget_exhausted (else invalid_state), must not be past its deadline (else deadline_passed), and must have a budget record (else no_budget). amount must be positive (else invalid_amount) and within the maximum (else budget_too_high).
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.