---
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

---

[API](https://skmtc.net/enterpilot/apis/gomodel-api.md) · [All operations](https://skmtc.net/enterpilot/apis/gomodel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/enterpilot/gomodel-api/versions/4c27ea61fcfe/schema)
