---
title: "Cancel a batch"
method: POST
path: "/v1/batches/{id}/cancel"
tags: ["batch"]
---

# Cancel a batch

`POST /v1/batches/{id}/cancel`

## Path parameters

- `id` string, required

## Response `200`

OK

- CoreBatchResponse
  - `cancelled_at` integer
  - `cancelling_at` integer
  - `completed_at` integer
  - `completion_window` string
  - `created_at` integer
  - `endpoint` string
  - `failed_at` integer
  - `id` string
  - `in_progress_at` integer
  - `input_file_id` string
  - `metadata` object
  - `object` string
  - `provider` string
  - `provider_batch_id` string
  - `request_counts` CoreBatchRequestCounts
    - `completed` integer
    - `failed` integer
    - `total` integer
  - `results` CoreBatchResultItem[]
    - `custom_id` string
    - `error` CoreBatchError
      - `message` string
      - `type` string
    - `index` integer
    - `model` string
    - `provider` string
    - `response` unknown
    - `status_code` integer
    - `url` string
  - `status` string
  - `usage` CoreBatchUsageSummary
    - `input_cost` number
    - `input_tokens` integer
    - `output_cost` number
    - `output_tokens` integer
    - `total_cost` number
    - `total_tokens` integer

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error
- `502` — Bad Gateway

## Changes

- **2026-08-22** `496ff50bdfef` — 5 info
  - added the optional property `error/provider` to the response with the `400` status
  - added the optional property `error/provider` to the response with the `401` status
  - added the optional property `error/provider` to the response with the `404` status
  - added the optional property `error/provider` to the response with the `500` status
  - …1 more
- **2026-04-19** `1a90f5d80e5a` — 30 warning, 5 info
  - removed the optional property `code` from the response with the `400` status
  - removed the optional property `code` from the response with the `401` status
  - removed the optional property `code` from the response with the `404` status
  - removed the optional property `code` from the response with the `500` status
  - …31 more

[Change history](https://skmtc.dev/enterpilot/apis/gomodel-api/changes/v1/batches/:id/cancel/post.md)

---

[API](https://skmtc.dev/enterpilot/apis/gomodel-api.md) · [All operations](https://skmtc.dev/enterpilot/apis/gomodel-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/enterpilot/gomodel-api/revisions/7b5727a74f59/schema)
