Async jobs

Stop a running job and get the credits back

Best-effort abort of the in-flight engine work, then a full refund of the reservation. Idempotent on a job that has already finished.

cancel_job

What it is

The job: Change your mind about a job that is still running, without paying for it.

Cancellation aborts the engine work as best it can, flips the run to cancelled, and refunds the reservation in full. There is no partial charge for work already done — a cancelled job costs nothing.

It is idempotent by design. Cancelling a job that has already completed, failed or been cancelled is a no-op that returns the job’s current state with cancelled: false, so a retrying client cannot corrupt anything or double-refund itself.

The call

Call it exactly like this.

Copied from the tool's registration and the route handler — not paraphrased.

MCPcancel_job.mcp.jsonjson
// MCP tool call — server "twin-browser"
{
  "tool": "cancel_job",
  "arguments": {
    "id": "…"
  }
}
POST /api/v1/jobs/{id}/cancelrequest.shbash
curl -X POST https://twin-browser.com/api/v1/jobs/JOB_ID/cancel \
  -H "Authorization: Bearer $TWIN_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
Parameters accepted by cancel_job
ParameterTypeWhat it does
id*stringThe job id to cancel.

Returns

response.jsonjson
{ "jobId": "…", "status": "cancelled", "cancelled": true }

What it costs

Free — full refund

The cancel itself is free, and it releases the job’s entire credit reservation. A job you cancel is a job you did not pay for.

See the full rate card

Which one

When a different tool is the right call.

The honest answer is often the neighbouring tool. These are the trades.

get_job

get_job tells you whether cancelling is still worth doing. A job already terminal cannot be cancelled — the call succeeds but returns cancelled: false.

get_job