curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/cancel' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"reason": "replaced by a fresher run"
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "pending",
"template": "string",
"summary": "Two-person tent, green — replacement for damaged pole set.",
"error": "string",
"input_tokens": 1,
"output_tokens": 1,
"cost_usd": 1.5,
"created_at": "2026-08-31T14:22:05Z",
"updated_at": "2026-08-31T14:22:05Z"
}
Cancel Job V1
Cancel a queued or running job. Mirrors the JWT-API behavior: sets the Redis cancel sentinel before flipping the DB row, so even an in-flight worker observes…
POST
/
api
/
v1
/
jobs
/
{job_id}
/
cancel
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/cancel' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"reason": "replaced by a fresher run"
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "pending",
"template": "string",
"summary": "Two-person tent, green — replacement for damaged pole set.",
"error": "string",
"input_tokens": 1,
"output_tokens": 1,
"cost_usd": 1.5,
"created_at": "2026-08-31T14:22:05Z",
"updated_at": "2026-08-31T14:22:05Z"
}
Confirm your deployment before running this request. This page describes an API contract;
a published reference does not establish hosted availability. Check the dated
host report and obtain your deployment URL and credentials.
Replace the example host if your provisioned service uses a different URL.
{'reason': '...'} is stamped on job.error so audit
trails show why a cancel happened. Without a body, the default
'Cancelled by user' is used (back-compat for clients that POST with
no payload).
Path parameters
Request body
CancelJobRequest,null
Free-form reason stamped on
job.error for audit. Cap is 500 chars; over-cap reasons return 422 (no silent truncation). Whitespace-only is normalized to no reason and the default 'Cancelled by user' audit string is used. Maximum length: 500.Response
JobStatusResponse
Pipe-separated final assistant text. Populated when the job reaches a terminal state. Truncated to ≈5 segments × 280 chars.
Cumulative billable cost. Priced at the job’s selected model rate (not the deployment default).
Status codes
| Code | Meaning |
|---|---|
200 | Successful Response |
422 | Validation Error |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.computer.stateset.app/api/v1/jobs/{job_id}/cancel' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"reason": "replaced by a fresher run"
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "pending",
"template": "string",
"summary": "Two-person tent, green — replacement for damaged pole set.",
"error": "string",
"input_tokens": 1,
"output_tokens": 1,
"cost_usd": 1.5,
"created_at": "2026-08-31T14:22:05Z",
"updated_at": "2026-08-31T14:22:05Z"
}
Last modified on September 21, 2026