OpenAI

Cancel a response

Cancel a model response that is still being generated.

Call Create response first, then replace resp_123 with the returned ID.

POST /openai/v1/responses/{response_id}/cancel◐ Partial

Official OpenAI docs ↗

Request parameters

  • response_idstring必填

    path:

Returns

200 response

Available only for responses created with background:true and routed to a model that can generate in the background. Cancel is idempotent — repeated calls return the same terminal response. Cancelling stops us reading the upstream stream; it cannot guarantee that compute already sent upstream stops, and usage is billed for what was actually received. Calling cancel on a non-background (synchronous) response returns 404 object_not_found if the response id does not exist (not stored, expired or wrong id), or 400 native_responses_operation_unsupported if the response exists but its provider does not declare cancel support (none of the upstreams we connect declares it for synchronous responses). Neither case is the not-implemented 501.

Errors follow the OpenAI format — see error codes

Response

HTTP 200

Native Responses API cancel response

application/json

NameTypeDescription
$object