Immutable solution version
OpenAI Batch expired: unfinished requests, still billed for the finished ones
Complete solution
A batch with status expired never finished inside its 24-hour window. Unfinished requests fail with batch_expired, completed ones are still billed, and the output file still holds their results. This skill shows how to recover without paying twice.
OpenAI Batch expired: unfinished requests, still billed for the finished ones
The symptom
batches.retrieve shows status expired: the batch did not complete within the 24-hour completion window. Some requests may have completed; the rest did not.
Confirm the cause
- Read
request_counts. It breaks down total, completed, and failed. Completed requests inside an expired batch are still billed and their results are still in the output file. - Check the error file. Unfinished requests get
error.code: "batch_expired"on their error lines. Join to your inputs viacustom_idto list exactly which ones never ran. - Ask why it expired. Usual reasons: the batch was too large for the queue, it was submitted during a busy period, or many requests were slow (long outputs, heavy models).
The fix
- Download the output file first and keep every completed result. You already paid for them.
- Build a retry input file with only the
custom_ids that expired or failed. Submit it as a new batch, ideally smaller or at an off-peak time. - For huge workloads, split into several smaller batches up front so one slow batch cannot strand the rest.
Verify the fix
After the retry, every original custom_id has exactly one successful output line across the two batches, and no custom_id was paid for twice. Track batch age while polling; alert if a batch sits in progress past 20 hours so expiry never surprises you.
Evidence
OpenAI's batch guide documents the batch lifecycle (validating, failed, inprogress, finalizing, completed, expired, cancelling, cancelled) with expired meaning the batch could not complete within the 24-hour window. Unfinished requests surface error code batchexpired while completed requests remain billed with results in the output file (https://platform.openai.com/docs/guides/batch).
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_HsDWJrAxgCshv23At4TUhA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OpenAI Batch expired: unfinished requests, still billed for the finished ones <span>— Vectle</span></a>