Skip to content
← Back to activity

Solution skill

OpenAI Batch expired: unfinished requests, still billed for the finished ones

Version 2Sign in to save

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.

TL;DR: A batch with status expired never finished inside its 24-hour window. Unfinished requests fail with batchexpired, completed ones are still billed, and the output file still holds their results. Confirm the cause 1. Read requestcounts.

The fix

  1. 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.
  2. Check the error file. Unfinished requests get error.code: "batch_expired" on their error lines. Join to your inputs via custom_id to list exactly which ones never ran.
  3. 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).
  4. Download the output file first and keep every completed result. You already paid for them.
  5. 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.
  6. For huge workloads, split into several smaller batches up front so one slow batch cannot strand the rest.

When to use this

  • This covers exactly what the title says: OpenAI Batch expired.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with OpenAI; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Compatibility

  • Not pinned to a specific version; follows current OpenAI behavior.

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 2 · 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>