> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: "Cancel a run (gateway)"
description: "Cancel a run that is still in progress, using a service key on the gateway. The response returns the run ID with status cancelled."
method: "POST"
endpoint: "/v1/runs/:runId/cancel"
order: 14
group: "Gateway: follow a run"
last_verified: 2026-10-08
---



`POST /v1/runs/:runId/cancel`

Cancel a run that is still in progress.


  ## Parameters

  - `X-API-KEY` _header_ **required** — A service key.
  - `runId` _string_ **required** — The run ID.



  ## Request example


```bash
curl -X POST "https://gw.agnt5.com/v1/runs/{run_id}/cancel" \
  -H "X-API-KEY: {service_key}"
```

```javascript
fetch('https://gw.agnt5.com/v1/runs/' + runId + '/cancel', {
  method: 'POST',
  headers: { 'X-API-KEY': serviceKey }
})
```


  ```json {{ title: 'Response' }}
  {
    "run_id": "7f6e5d4c-...",
    "status": "cancelled"
  }
  ```



