openai · OpenAI Platform Docs
Background mode | OpenAI API
Explains how to use the Background mode in the OpenAI API to handle long-running requests asynchronously.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Background mode | OpenAI API
Explains how to use the Background mode in the OpenAI API to handle long-running requests asynchronously.
When To Use
Use when you need to implement asynchronous processing for long-running API requests to prevent timeouts or manage resource availability.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/background-mode-openai-api-workflow-guide.md | A guide explaining how to poll, cancel, and stream long-running background responses using the OpenAI API. | Questions about a guide explaining how to poll, cancel, and stream long-running background responses using the OpenAI API. |
examples/background-mode-openai-api-openai-api-background-mode-curl-request.text | A curl command demonstrating how to initiate an asynchronous request using the background parameter in the OpenAI API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to initiate an asynchronous request using the background parameter in the OpenAI API. |
examples/background-mode-openai-api-openai-api-background-mode-nodejs.text | A Node.js code example demonstrating how to initiate an asynchronous background request using the OpenAI client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initiate an asynchronous background request using the OpenAI client. |
examples/background-mode-openai-api-openai-api-background-mode-python.text | A Python code example demonstrating how to initiate an asynchronous background request using the OpenAI API client. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initiate an asynchronous background request using the OpenAI API client. |
examples/background-mode-openai-api-openai-api-background-mode-curl-request-2.text | A curl command demonstrating how to poll for a response status using the OpenAI API background mode. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to poll for a response status using the OpenAI API background mode. |
examples/background-mode-openai-api-openai-api-background-mode-nodejs-2.text | A Node.js code example demonstrating how to initiate an asynchronous request using the background parameter and poll for status updates. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initiate an asynchronous request using the background parameter and poll... |
examples/background-mode-openai-api-openai-api-python-background-mode-polling.text | A Python script demonstrating how to initiate an asynchronous request using the background parameter and poll the response status. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to initiate an asynchronous request using the background parameter and poll the res... |
examples/background-mode-openai-api-openai-api-background-mode-cancel-response-cu.text | A curl command demonstrating how to cancel a background mode response via the OpenAI API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to cancel a background mode response via the OpenAI API. |
examples/background-mode-openai-api-openai-api-background-mode-nodejs-cancel-resp.text | A Node.js code example demonstrating how to cancel an ongoing background mode response using the OpenAI client. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to cancel an ongoing background mode response using the OpenAI client. |
examples/background-mode-openai-api-openai-api-python-cancel-response-background-.text | A Python code snippet demonstrating how to cancel an ongoing response using the OpenAI client in background mode. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to cancel an ongoing response using the OpenAI client in background mode. |
examples/background-mode-openai-api-openai-api-background-mode-curl-request-3.text | A curl command demonstrating how to initiate a background request and resume a stream using the OpenAI API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to initiate a background request and resume a stream using the OpenAI API. |
examples/background-mode-openai-api-openai-api-background-mode-nodejs-3.text | A Node.js code example demonstrating how to initiate a background mode request using the OpenAI client to handle long-running tasks. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initiate a background mode request using the OpenAI client to handle long... |
examples/background-mode-openai-api-openai-api-python-background-mode-streaming.text | A Python code example demonstrating how to initiate an asynchronous response with immediate streaming using the background parameter in the OpenAI API. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initiate an asynchronous response with immediate streaming using the backg... |
What This Skill Covers
- Agents like Codex and Deep Research show that reasoning models can take several minutes to solve complex problems. Background mode enables you to execute lon...
- Main sections:
Polling background responses,Cancelling a background response,Streaming a background response,Limits.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/background
