# Cancel a batch

Launch stage: Beta

`POST /api/2.0/ai-functions/batches/{name}/cancel`

Starts the asynchronous cancellation of a batch. Requests in progress are drained first. Cancellation is best effort, so the batch can still complete.

API scopes: ai-functions

## Path parameters

- `name` (string, required)
  Resource name of the batch. Format: `batch_<id>`.

## Response

```json
{}
```

