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
Request Body
Response
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.Tool holds
A goal that requests a tool it cannot proceed without (request_tool with blocking: true, where the tool needs a key, licence, customer account or action channel) waits in awaiting_tool. Its sessions keep their saved steps and spend.
The owner is notified in-app. If the goal has a webhook URL, an unregulated signed goal.awaiting_tool webhook also names the requested tool. Regulated webhooks carry only IDs, status, timestamps and an authenticated content-read path.
A hold ends when:
- The tool ships or the owner continues without it: the goal resumes.
- The owner cancels it here.
- 7 days pass: the goal is cancelled with
end_reason: tool_timeoutand its unused budget becomes credit.