模型

取消响应

取消一条仍在生成的后台响应。

先调用「生成响应」,用返回的 ID 替换 resp_123。

POST /model/v1/responses/{response_id}/cancel◐ 部分支持

官方文档 ↗

请求参数

  • response_idstring必填

    path: Id of the stored response, the `id` returned by createResponse (it looks like resp_...). An unknown id, a response created with store false, an expired response and another tenant's response all answer 404.

返回

200 response

仅对以 background:true 创建、且路由到具备后台生成能力的模型的响应可用:取消是 幂等的,重复调用返回同一个终态响应;我方的取消只能停止我方对上游流的继续读取, 不能保证已发往上游的算力停止计算,用量按实际收到的部分结算。对一个非后台 (同步)响应调用 cancel:如果这个响应 id 不存在(未持久化、已过期或 id 有误), 返回 404 object_not_found;如果响应存在但其来源 provider 没有声明支持 cancel 操作(我们目前没有接入任何为同步响应声明该能力的上游),返回 400 native_responses_operation_unsupported。这两种情况都不是尚未实现的 501 gate。

鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码

响应

HTTP 200

Native Responses API cancel response

application/json

名称类型说明
$object