OP Inference
API reference

Cancel a tool run

POST
/v1/tools/runs/{id}/cancel

Ask for a queued or processing run to stop. A run that has already finished answers 409.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Your API key, sent as Authorization: Bearer <key>.

Path Parameters

id*string

The run id from the 202 response.

Response Body

The run, as it stands after the cancel was accepted.

application/json
  1. response
id*string
object*string
tool*string
status*string
Value in"queued""processing""succeeded""failed""canceled"
outcome?"no_match"

Set on a succeeded run that found nothing. Billed like any other answer.

Value in"no_match"
output?array<>

The result, as signed links like a job's output.

error?
usage?
created_at*string
Formatdate-time
completed_at?string
Formatdate-time
curl -X POST "https://example.com/v1/tools/runs/string/cancel" \  -H "Authorization: Bearer $OP_API_KEY"
{  "id": "string",  "object": "tool.run",  "tool": "string",  "status": "queued",  "outcome": "no_match",  "output": [    {      "url": "string",      "url_expires_at": "2019-08-24T14:15:22Z",      "type": "string",      "bytes": 0    }  ],  "error": {    "code": "string",    "kind": "string",    "scope": "string",    "message": "string"  },  "usage": {    "units": {      "property1": 0,      "property2": 0    },    "cost": {      "billing_usd": 0,      "cost_source": "string",      "cost_status": "string",      "price_version": "string"    }  },  "created_at": "2019-08-24T14:15:22Z",  "completed_at": "2019-08-24T14:15:22Z"}