> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vivix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# response.cancel

取消正在进行的响应。服务端返回 `response.done`，其中响应状态为 `cancelled`。如果没有可取消的响应，服务端会返回错误。

**`response.cancel`** 以当前活动响应为目标。取消当前响应时可以省略 `response_id`，也可以提供与之匹配的 ID。取消成功还会清除等待中的任务。没有活动响应或 ID 不匹配时会产生错误；该事件不能只移除等待中的响应。

## 事件字段

**event\_id** `string`

客户端为本事件生成的 ID。

**type** `string` *required*

事件类型。必须为 `response.cancel`。

**response\_id** `string`

提供时，必须与当前活动响应 ID 匹配。省略则取消当前活动响应。使用 `response.created.response.id` 中的 ID。

```json response.cancel theme={null}
{
  "event_id": "evt_response_cancel_001",
  "type": "response.cancel",
  "response_id": "resp_001"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.