putty
API ReferenceEngine

Cancel a run

Requests cancellation of a queued or running run. A queued run is cancelled immediately. A running run is marked cancelled and the worker observes it at its next heartbeat, so this call does not wait for the agent to stop. Cancelling a run that has already finished is a no-op that returns the finished run unchanged, so a client that cancels twice does not get an error.

POST
/projects/{projectId}/runs/{runId}/cancel

Requests cancellation of a queued or running run. A queued run is cancelled immediately. A running run is marked cancelled and the worker observes it at its next heartbeat, so this call does not wait for the agent to stop. Cancelling a run that has already finished is a no-op that returns the finished run unchanged, so a client that cancels twice does not get an error.

Path Parameters

projectId*string

The project the run belongs to.

runId*string

The run to cancel.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/projects/string/runs/string/cancel"
{  "id": "string",  "projectId": "string",  "status": "queued",  "prompt": "string",  "model": "string",  "recipeId": "string",  "steps": 0,  "tokensIn": 0,  "tokensOut": 0,  "sandboxMs": 0,  "error": "string",  "startedAt": "string",  "finishedAt": "string",  "createdAt": "string"}