---
title: "Delete a batch"
method: DELETE
path: "/batch/{batch_id}"
tags: ["Batch"]
---

# Delete a batch

`DELETE /batch/{batch_id}`

Permanently delete a finished batch and its stored results. Active batches must settle first.

## Path parameters

- `batch_id` string, required — ID of the batch to retrieve or cancel.

## Response `200`

Batch and its stored results are permanently deleted.

- object
  - `id` string — ID of the deleted batch.
  - `deleted` boolean — Always true on success.
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `401` — Unauthorized
- `404` — Not found
- `409` — Batch is still active. Cancel it and let it settle before deleting.

---

[API](https://skmtc.net/context/apis/context-dev.md) · [All operations](https://skmtc.net/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context/context-dev/versions/182f532c2552/schema)
