Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/background-mode-openai-api-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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-.textA 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.textA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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