roasOS
API referenceJobs

Cancel a job

Cancel a job that has not finished. The engine reads the cancellation immediately before it submits the request to the model provider. When the job has not been submitted, the run stops, the whole credit reservation is refunded, the job becomes canceled, and the response returns cancel_honoured: true. When the provider already holds the request it cannot be recalled: the cancellation is recorded, the run finishes, the job is billed normally, and the response returns cancel_honoured: false. A job that already finished answers 409 job_not_cancelable.

POST
/v1/jobs/{id}/cancel

Cancel a job that has not finished. The engine reads the cancellation immediately before it submits the request to the model provider. When the job has not been submitted, the run stops, the whole credit reservation is refunded, the job becomes canceled, and the response returns cancel_honoured: true. When the provider already holds the request it cannot be recalled: the cancellation is recorded, the run finishes, the job is billed normally, and the response returns cancel_honoured: false. A job that already finished answers 409 job_not_cancelable.

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Use your API key as the bearer token: Authorization: Bearer roasos_sk_...

In: header

Path Parameters

id*string
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/jobs/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel"
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "kind": "image",    "model": "string",    "status": "queued",    "credits_reserved": 0,    "created_at": "string",    "completed_at": "string",    "error": {      "code": "string",      "message": "string"    },    "result": null,    "webhook": {      "status": "delivered",      "attempts": 0,      "last_status": "string",      "delivered_at": "string",      "failed_at": "string"    },    "inputs": {      "endpoint": "string",      "request": {        "property1": null,        "property2": null      }    },    "links": {      "self": "string",      "status": "string",      "result": "string",      "events": "string"    }  }}