---
title: "Cancel in-progress generation"
method: POST
path: "/chats/{chat_id}/cancel"
tags: ["Chat"]
---

# Cancel in-progress generation

`POST /chats/{chat_id}/cancel`

## Request

- Base URL: `https://api.your-domain.com`
- URL: `https://api.your-domain.com/chats/{chat_id}/cancel`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/docs/chats/:chat_id/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

Cancel any pending or streaming message generation in the chat.

## Path parameters

- `chat_id` integer, required

## Query parameters

- `cookie_name` string, nullable

## Response `201`

Successful Response

- unknown

## Other responses

- `401`: Missing or invalid authentication.
- `403`: No access to this chat.
- `422`: Validation Error

---

[API](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api.md) - [All operations](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/revisions/b53e89b98c2b?raw)
