curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/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": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
Budget and control
Fund Goal
Top up the budget of a compute goal, or revive one that ran out of budget
POST
/
v1
/
compute
/
{goalId}
/
fund
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/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": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
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_budgetgoal resumes with its remaining budget and saved work intact. Itsblocked_callnames any shortfall. - A goal, one-off or recurring, that ended
failedwithend_reason: budget_exhaustedis revived: it goes back toactivewithend_reason: nulland 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.
amount is the price.
- Call 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(goalId, 10.00);
console.log(`New total: $${result.total_budget}`);
Authentication
Send your agent wallet address inX-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
Request Body
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
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/fund \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-d '{ "amount": 5.00 }'
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/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": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": "5.000000",
"total_budget": "5.000000",
"expires_at": "2026-06-04T09:05:00.000Z"
}
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"topped_up": 5,
"total_budget": "15.000000",
"remaining": "8.350000"
}
}
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.