Responses API Background Completions: Design the Resume Path First
OpenAI added two-hour and eight-hour background completion windows. The engineering question is how a job resumes, not how long it waits.
I do not like representing a long-running agent as one HTTP request that stays open until the model returns. Networks fail, browsers close, users change their requirements, and the worker may restart halfway through a tool call. On November 17, OpenAI’s API changelog added two-hour and eight-hour background completion windows to the public beta of the Responses API. It also says the token rates for those windows are 30% and 40% lower than Standard, respectively. The practical change for me is not “the request can wait longer.” It is that the resume path now needs to be designed before the call is made.
The same changelog lists GPT-6.2 Astra for demanding reasoning and coding tasks and GPT-6.2 Sol for everyday coding and agent workflows. It also says tool calling requires the Responses API. Those are separate decisions. Model selection is about capability; background completion is about job lifecycle. Combining them into one switch called “run a stronger model for longer” usually creates work that is hard to cancel, bill, and explain. The official changelog is the source I would use for the current window and model details.
Write the state machine before the request
I would treat a background completion as a database-backed job, not as a Promise:
{
"job_id": "job_123",
"status": "running",
"window": "2h",
"input_hash": "sha256:...",
"last_event": "tool_result_saved",
"cancelled": false
}
last_event is more useful than a vague percentage. After a worker restart, the job runner can decide where to continue from the event log. When a user cancels, the system has a durable record of the cancellation instead of merely losing the browser connection. Many production failures happen after the model has returned, when the result was not safely persisted or a tool side effect was repeated.
I would separate event persistence from side effects. A model output can be read again; a payment, notification, or permission change cannot safely be repeated. Every tool call should carry the job ID and an idempotency key, and the job should advance only after the result is stored. If the background window ends or the worker is reclaimed, the next worker can then distinguish completed work from work that still needs attention.
A longer window is not a product guarantee
OpenAI publishes the two-hour and eight-hour options and their relative token-rate reduction, but it does not define the success criteria for my application. I would add a deadline, a maximum number of tool calls, a budget, and a human handoff point. An eight-hour window may fit research, code review, or a workflow that waits for another system. It does not mean the job should run without limits.
The discount also has to be measured against completion quality. If a Standard run consumes 100 billing units, the published relative rates suggest a reference of about 70 units for the two-hour window and 60 for the eight-hour window. That is a proportional example, not a price quote. If the background job performs two extra tool loops or the final answer requires a developer to redo the work, the apparent saving disappears.
Cancellation needs to be a real operation:
POST /jobs/job_123/cancel
-> mark cancellation requested
-> stop new tool calls
-> persist final event
-> show partial result and reason
The UI button is only the visible part. The worker must stop new side effects, especially messages, ticket updates, production configuration changes, and payments. A cancellation request that arrives after a tool has started also needs an explicit outcome, so the user can tell whether the side effect completed.
I would rehearse failure before production
Before connecting a business workflow, I would terminate the worker at three points: before the model response, after a tool call, and before the result is stored. On every restart I would check for duplicate tool execution, correct resume from last_event, and a user-visible explanation of the current state. Any external side effect should carry an idempotency key. The model cannot be expected to remember what happened before a process restart.
The Responses API reference is the place to verify request fields and response structures. The Agents API guide provides the broader context for sessions, tools, and long-running agent work. My view is that background completion makes an agent look more like an operated work queue than a chat request. I would implement recovery, cancellation, and side-effect auditing first, then decide which jobs genuinely deserve the eight-hour window.
That also changes the user interface. I would show the job ID, current state, last durable event, next expected action, and a clear cancellation result. A spinner hides the exact information that matters when a job runs for hours. The product should make “waiting,” “blocked on approval,” “failed after retry,” and “completed with partial output” visibly different states.
