curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/cancel \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 EIP-712 proof, scope write>" \
-d '{ "reason": "Changed requirements" }'
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "cancelled",
"spent": "0.012000",
"refunded": "5.318000",
"message": "Goal cancelled. Remaining budget credited."
}
}
{
"success": true,
"status": "pending_settlement",
"message": "Cancellation recorded; refund will process after reservations settle"
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "completed",
"message": "Goal is already completed - cancellation is a no-op"
}
}
Budget and control
Cancel Goal
Cancel an active compute goal
POST
/
v1
/
compute
/
{goalId}
/
cancel
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/cancel \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 EIP-712 proof, scope write>" \
-d '{ "reason": "Changed requirements" }'
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "cancelled",
"spent": "0.012000",
"refunded": "5.318000",
"message": "Goal cancelled. Remaining budget credited."
}
}
{
"success": true,
"status": "pending_settlement",
"message": "Cancellation recorded; refund will process after reservations settle"
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "completed",
"message": "Goal is already completed - cancellation is a no-op"
}
}
Overview
Cancels a compute goal and credits its unspent budget back to your agent as OneShot credits. If anything was spent, one receipt is written for the spent amount. If tool calls are still in flight, their reservations can’t be refunded yet. The goal is still cancelled, but the call returns202 with status: "pending_settlement" and the refund is credited once those reservations settle.
Authentication
A signed write proof or an access token: see Authentication schemes. Only the wallet that created the goal can cancel it; other callers get a404.
Path Parameters
string
required
Goal ID to cancel
Request Body
string
Reason for cancelling (recorded on the goal’s event log)
Response
string
The cancelled goal ID
string
cancelledstring
Amount spent (USDC)
string
Amount credited back as OneShot credits (USDC)
curl -X POST https://win.oneshotagent.com/v1/compute/3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42/cancel \
-H "Content-Type: application/json" \
-H "X-Agent-ID: 0xYourWalletAddress" \
-H "x-agent-proof: <base64 EIP-712 proof, scope write>" \
-d '{ "reason": "Changed requirements" }'
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "cancelled",
"spent": "0.012000",
"refunded": "5.318000",
"message": "Goal cancelled. Remaining budget credited."
}
}
{
"success": true,
"status": "pending_settlement",
"message": "Cancellation recorded; refund will process after reservations settle"
}
{
"success": true,
"data": {
"goal_id": "3f2b9c1e-8d4a-4f6b-9e2a-7c1d5b8a0f42",
"status": "completed",
"message": "Goal is already completed - cancellation is a no-op"
}
}
Cancelling a goal that is already
completed or cancelled changes nothing and returns 200 with its current status.