Responses API completion_window: 2h and 8h Discounts
Configure discounted Responses API background requests with the correct nested fields. Compare soonest, 2h, and 8h pricing; retrieve results; and preserve scheduling priority and conversation history across follow-ups.
Contents

If your team’s API reviews can wait several hours, use a Responses API completion window to reduce eligible model-token charges. Set background_options.completion_window to 2h or 8h, with background: true and service_tier: "default". Follow the documented completion-window settings: do not send completion_window at the top level or enable streaming for these discounted windows.
Choose soonest, 2h, or 8h
Choose the window according to when you need the first response, not how long you expect the model to think. As of 2026-11-19, OpenAI’s background-mode guide defines these options and discounts.
| Window | Model-token discount versus Standard | Use it when |
|---|---|---|
soonest | None; this is the default | Someone needs the result on demand. |
2h | 30% | A review can finish before a later meeting or processing step. |
8h | 40% | An overnight review or document analysis can wait until morning. |
Setting background: true alone does not select a discount. Without a completion-window setting, the request uses soonest. For 2h and 8h, the completion target starts when the API accepts the initial request and applies to that response. It is not an end-to-end deadline for every subsequent tool call and follow-up.
For a calculated token-only example, assume an Astra request has 100,000 uncached input tokens and 10,000 billed output tokens. Assume no cache writes, paid tools, storage charges, or regional processing uplift.
As of 2026-11-19, OpenAI’s Standard pricing table lists Astra’s short-context rates as $8 per 1M input tokens and $40 per 1M output tokens. The Astra model card applies long-context adjustments above 272K input tokens. This example’s 100,000 input tokens stay below that threshold.
The estimated Standard model-token cost is:
(100,000 / 1,000,000 × $8) + (10,000 / 1,000,000 × $40) = $1.20
For the same token quantities, 2h gives $1.20 × 0.70 = $0.84, and 8h gives $1.20 × 0.60 = $0.72. These are calculated examples, not measured request charges.
The discount applies to eligible model-token rates, including follow-up requests. Do not apply the percentage to unrelated charges on the invoice. For cached workloads, calculate writes and reads separately using the prompt-cache cost guide.
Check the model and choose an access route
Use OpenAI’s Responses API directly when you need the documented completion-window controls. As of 2026-11-19, the eligible-model list names GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra, and GPT-6 Luna for the public beta. The GPT-6.2 model IDs are gpt-6.2-astra and gpt-6.2-sol.
For model selection and migration details, see the GPT-6.2 Astra and Sol API guide. Choose the access route separately from the model:
| Route | What it requires | When to choose it |
|---|---|---|
| OpenAI Responses API | An API project and key, access from a supported country or territory, and API billing or available API credits. Usage is metered separately from a ChatGPT subscription. | You need 2h or 8h controls, particularly when later requests depend on earlier results. |
| OpenAI Batch API | The same API access and billing arrangements, plus file-based submission of independent requests. | All inputs are known upfront. Use the Batch API workflow rather than coordinating dependent turns. |
| BetterToken | Your own account and API key, a compatible client, and payment options available in its console. Usage follows each model’s billing unit. | You are comparing broader pay-as-you-go model access. Check BetterToken prices, and verify completion-window support separately before routing this workflow through a gateway. |
Do not assume a ChatGPT or Codex subscription exposes these request options. The documented path here is a Responses API request, with API billing separate from ChatGPT. Codex’s API-key authentication uses API billing rather than included plan credits; that alone does not establish a completion-window control in Codex.
Submit the nested background_options correctly
Put completion_window and continuation_id inside background_options. Keep background, service_tier, and stream at the top level, as specified by the Responses request schema. Standard processing is required; service_tier: "default" selects it.
The following Bash example requires curl, jq, and uuidgen. Run the blocks in the same shell and working directory. When read waits, paste your OpenAI API key and press Enter; the key is not echoed or entered into shell history.
This example generates a continuation ID because it will demonstrate a second turn. It requests stored responses and writes local JSON files, so review your data-handling requirements before substituting sensitive documents.
set +x
set -euo pipefail
read -rs OPENAI_API_KEY && export OPENAI_API_KEY
CONTINUATION_ID=$(uuidgen)
jq -n --arg continuation_id "$CONTINUATION_ID" '{
model: "gpt-6.2-astra",
input: "Review this migration plan for risks: add a nullable column, backfill it in batches, switch reads, then enforce NOT NULL.",
background: true,
service_tier: "default",
stream: false,
store: true,
background_options: {
completion_window: "8h",
continuation_id: $continuation_id
}
}' > background-request.json
curl --fail-with-body --silent --show-error \
https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @background-request.json \
--output background-response.json
jq -er '.id' background-response.json > background-response-id.txt
jq '{id, status, service_tier}' background-response.json
The first success check is a returned response id, saved in background-response-id.txt. A status of queued or in_progress means the result is not ready. Keep that ID rather than submitting the same work again.
Poll the saved response ID or use a webhook
Retrieve the existing response with GET /v1/responses/{response_id}. The polling loop below continues only for queued and in_progress; it stops successfully at completed and reports other terminal states. The 30-second polling interval is an example choice, not an API requirement.
RESPONSE_ID=$(cat background-response-id.txt)
while :; do
curl --fail-with-body --silent --show-error \
"https://api.openai.com/v1/responses/$RESPONSE_ID" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
--output background-response.json
STATUS=$(jq -r '.status' background-response.json)
case "$STATUS" in
queued|in_progress) sleep 30 ;;
completed) break ;;
*)
jq '{id, status, error, incomplete_details}' background-response.json
exit 1
;;
esac
done
cp background-response.json "$RESPONSE_ID.json"
jq '{id, status, service_tier, usage}' background-response.json
jq -r '.output[]? | select(.type == "message") |
.content[]? | select(.type == "output_text") | .text' \
background-response.json
For this text-only example, success means completed plus review text printed from the response’s message content. The extraction checks item types rather than assuming the first output item contains text. If an HTTP retrieval fails, retain the ID file and rerun the polling block instead of the submission block.
For production, use the webhook receiver instructions instead of keeping a shell open. Subscribe to response.completed, verify the incoming signature, and retrieve the response identified by event.data.id. Deduplicate deliveries with webhook-id before launching follow-up work, and provide a handling path for unsuccessful outcomes.
Continue the workflow without losing history or priority
Reuse the completion window, continuation ID, model, and API project to qualify related requests for higher queue priority. Keep Standard processing and background execution enabled on the follow-up. OpenAI’s follow-up workflow makes priority conditional on scheduling; it does not promise an immediate start.
The identifiers have different jobs. background_options.continuation_id is an application-chosen scheduling identifier; it does not supply conversation history. previous_response_id points to the earlier response and carries the conversation forward while that response remains available.
After the first request completes, this block preserves its model, window, continuation ID, and processing settings. It adds the previous response ID and a new instruction. Use a key from the same API project throughout.
RESPONSE_ID=$(cat background-response-id.txt)
jq --arg previous_response_id "$RESPONSE_ID" \
'.previous_response_id = $previous_response_id |
.input = "Turn the two highest-risk findings into acceptance tests."' \
background-request.json > background-followup.json
curl --fail-with-body --silent --show-error \
https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @background-followup.json \
--output background-response.json
jq -er '.id' background-response.json > background-response-id.txt
Run the polling block again to retrieve this new response. The follow-up is a separately billed request; eligible model-token rates receive the selected discount. Matching the continuation settings qualifies it for priority, rather than creating an additional discount. Chained conversation history still contributes billed input tokens.
For function-tool workflows, send a function_call_output input item containing the original call_id and the tool result in output. The function-calling guide describes that exchange. Do not replace the conversation-history mechanism with a continuation ID; it cannot reconstruct an expired response.
Check queue limits and billing before scaling up
Plan discounted background traffic together with Batch traffic. Requests using 2h or 8h share the Batch/Background Rate Limit, and input tokens count at submission. Check that shared capacity before increasing scheduled workload volume; an available monetary balance is a separate concern.
If submission fails, compare the reported parameter with the request schema before retrying a small job. Check the nesting, model eligibility, Standard processing, and non-streaming requirement as applicable. A returned ID confirms acceptance; use the retrieval step to establish whether generation actually completes.
If charges look undiscounted, inspect the saved request for an explicit 2h or 8h window, not only background: true. Check the response’s service_tier, which reports the processing mode actually used. Retain the submitted JSON and returned usage, then reconcile the first job against current API pricing before applying the configuration to the entire queue.