POST
POST /responses/{response_id}/cancel — OpenAI API
OpenAI API key (required); https://api.openai.com/v1
OpenAI APICancel a response
- Base URL
- https://api.openai.com/v1
- Auth
- Authorization: Bearer <OPENAI_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 162 tokens · Vary: Accept
→ 162 tokens · Vary: Accept
Critical gotchas
The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.
Audio transcription uploads use multipart form data rather than a JSON request body.
cURL
curl -X POST 'https://api.openai.com/v1/responses/resp_677efb5139a88190b512bc3fef8e535d/cancel' \ -H "Authorization: Bearer $OPENAI_API_KEY"
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| response_id | path | string | Yes | The ID of the response to cancel. |
Response 200 OK
{
"metadata": {},
"top_logprobs": 0,
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"safety_identifier": "safety-identifier-1234",
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"previous_response_id": "string",
"model": "gpt-6-astra",
"background": false,
"max_tool_calls": 0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tools": [
{
"type": "function",
"name": "string",
"async": true,
"description": "string",
"parameters": {},
"output_schema": {},
"strict": true,
"defer_loading": true,
"allowed_callers": [
"direct"
]
}
],
"tool_choice": "none",
"prompt": {
"id": "string",
"version": "string",
"variables": {}
},
"service_tier": "auto",
"truncation": "disabled",
"id": "string",
"object": "response",
"status": "completed",
"access_programs": {
"cyber": "standard"
},
"created_at": 0,
"completed_at": 0,
"error": {
"type": "string",
"param": "string",
"code": "server_error",
"message": "string",
"misalignment": {
"review_target": "string",
"error_type": "string",
"detailed_explanation": "string",
"steer": {
"message": "string"
}
}
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"output": [
{
"id": "string",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "string",
"annotations": [
"[recursive or deeply nested schema]"
],
"logprobs": [
"[recursive or deeply nested schema]"
]
}
],
"phase": "commentary",
"status": "in_progress"
}
],
"reasoning": {
"mode": "string",
"effort": "medium",
"summary": "auto",
"context": "auto",
"generate_summary": "auto"
},
"instructions": "string",
"output_text": "string",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"prompt_cache_options": {
"ttl": "30m",
"mode": "implicit",
"comparison_response_id": "string"
},
"prompt_cache_diagnostics": {
"type": "cache_miss",
"reason": "model_changed",
"cache_missed_tokens": 0,
"comparison_reusable_tokens": 0
},
"moderation": {
"input": {
"type": "moderation_result",
"model": "string",
"flagged": true,
"categories": {},
"category_scores": {},
"category_applied_input_types": {}
},
"output": {
"type": "moderation_result",
"model": "string",
"flagged": true,
"categories": {},
"category_scores": {},
"category_applied_input_types": {}
}
},
"parallel_tool_calls": true,
"conversation": {
"id": "string"
},
"max_output_tokens": 0
} Get a free OpenAI API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.