curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "X-Quote-Id: quote_01HX..." \
-H "Payment-Signature: <base64 x402 payment>" \
-d '{ "amount": 5.00 }'
{
"error": "payment_required",
"message": "Payment required to fund compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.000000",
"recipient": "0xMerchantWallet..."
},
"context": {
"tool": "compute_fund",
"quote_id": "quote_01HX...",
"goal_id": "goal_01HX8K3YZ...",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "goal_01HX8K3YZ...",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
Compute
Fund Goal
Top up the budget of a recurring compute goal
POST
/
v1
/
compute
/
{goalId}
/
fund
curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "X-Quote-Id: quote_01HX..." \
-H "Payment-Signature: <base64 x402 payment>" \
-d '{ "amount": 5.00 }'
{
"error": "payment_required",
"message": "Payment required to fund compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.000000",
"recipient": "0xMerchantWallet..."
},
"context": {
"tool": "compute_fund",
"quote_id": "quote_01HX...",
"goal_id": "goal_01HX8K3YZ...",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "goal_01HX8K3YZ...",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
Overview
Tops up the budget of a recurring compute goal so it can keep running on its schedule. The requestedamount (USDC) is added to both the goal’s total and
remaining budget. One-off goals cannot be funded — fund a recurring goal or
create a new goal instead.
This is a paid endpoint that uses the x402 quote-then-pay flow, exactly like
creating a goal: the top-up amount IS the price.
- Call once with
{ amount }and no payment → you get a 402 with apayment_requestand acontext.quote_id. - Sign the USDC payment authorization and call again with the
X-Quote-Idheader and the payment signature → the budget is credited and you get a 200.
const result = await agent.fundComputeGoal('goal_01HX...', 10.00);
console.log(`New total: $${result.total_budget}`);
Authentication
Send your agent wallet address in theX-Agent-ID header. Only the wallet that
created the goal can fund it; other callers get a 404. The wallet that pays must
be the goal owner — payment from any other wallet is rejected when the quote is
redeemed.
Path Parameters
string
required
The goal ID to top up
Request Body
number
required
Amount to add to the goal’s budget, in USDC. Must be a positive number.
Response
string
The funded goal ID
number
Amount added to the budget (USDC)
string
New total budget after the top-up (USDC)
string
New remaining budget after the top-up (USDC)
curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/goal_01HX8K3YZ/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "X-Quote-Id: quote_01HX..." \
-H "Payment-Signature: <base64 x402 payment>" \
-d '{ "amount": 5.00 }'
{
"error": "payment_required",
"message": "Payment required to fund compute goal.",
"payment_request": {
"chain_id": 8453,
"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5.000000",
"recipient": "0xMerchantWallet..."
},
"context": {
"tool": "compute_fund",
"quote_id": "quote_01HX...",
"goal_id": "goal_01HX8K3YZ...",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "goal_01HX8K3YZ...",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
Only recurring goals can be funded (
not_recurring error otherwise), and the goal must have an existing budget record (no_budget error otherwise).