openai · OpenAI Platform Docs
Background mode
Teaches how to implement asynchronous long-running tasks using background mode, including polling for status, cancelling in-flight requests, and managing streaming responses with cursors.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Background mode
Teaches how to implement asynchronous long-running tasks using background mode, including polling for status, cancelling in-flight requests, and managing streaming responses with cursors.
When To Use
Use when you need to execute complex reasoning tasks that exceed standard timeout limits or when you need to manage long-running asynchronous model responses via polling or streaming.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/background-mode-workflow-guide.md | A guide explaining how to poll, cancel, and stream background responses using the OpenAI API. | Questions about a guide explaining how to poll, cancel, and stream background responses using the OpenAI API. |
examples/background-mode-openai-api-background-mode-curl-request.bash | A bash curl command demonstrating how to initiate an asynchronous API request using the background parameter. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to initiate an asynchronous API request using the background parameter. |
examples/background-mode-openai-api-javascript-background-mode.javascript | A JavaScript code example demonstrating how to initiate an asynchronous request using the background parameter in the OpenAI client. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to initiate an asynchronous request using the background parameter in the... |
examples/background-mode-openai-api-python-background-mode-request.python | A Python script demonstrating how to initiate an asynchronous API request using the background parameter in the OpenAI client. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to initiate an asynchronous API request using the background parameter in the OpenA... |
examples/background-mode-openai-api-background-mode-curl-request-2.bash | A bash curl command demonstrating how to initiate a background mode request to the OpenAI API. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to initiate a background mode request to the OpenAI API. |
examples/background-mode-openai-api-javascript-background-mode-polling.javascript | A JavaScript example demonstrating how to initiate an OpenAI API request with background mode enabled and poll the response status until completion. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to initiate an OpenAI API request with background mode enabled and poll the re... |
examples/background-mode-openai-api-python-background-mode-polling.python | A Python script demonstrating how to initiate an asynchronous background request and poll for its status using the OpenAI client. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to initiate an asynchronous background request and poll for its status using the Op... |
examples/background-mode-openai-api-background-mode-cancel-response-curl.bash | A curl command demonstrating how to cancel a background mode response using the OpenAI API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to cancel a background mode response using the OpenAI API. |
examples/background-mode-openai-api-javascript-background-mode-cancel-response.javascript | A JavaScript example demonstrating how to cancel an ongoing background mode response using the OpenAI client. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to cancel an ongoing background mode response using the OpenAI client. |
examples/background-mode-openai-api-python-background-mode-cancel-response.python | A Python script demonstrating how to use the OpenAI client to cancel a background mode response. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to cancel a background mode response. |
examples/background-mode-openai-api-background-mode-curl-request-3.bash | A bash script demonstrating how to initiate and resume an asynchronous background request using curl against the OpenAI API. | Exact payloads, commands, or snippets shown in A bash script demonstrating how to initiate and resume an asynchronous background request using curl against the Open... |
examples/background-mode-openai-api-javascript-background-mode-streaming-resume.javascript | A JavaScript example demonstrating how to initiate a background mode stream and use sequence numbers to resume streaming if a connection is interrupted. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to initiate a background mode stream and use sequence numbers to resume stream... |
examples/background-mode-openai-api-python-background-mode-streaming.python | A Python script demonstrating how to initiate an asynchronous background response while simultaneously streaming events from the OpenAI API. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to initiate an asynchronous background response while simultaneously streaming even... |
What This Skill Covers
- To check the status of background requests, use the GET endpoint for Responses. Keep polling while the request is in the queued or inprogress state. When it...
- 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.md
