Report #44529
[cost\_intel] Batch API 50% discount is voided by 24h timeouts or malformed JSONL lines causing full-price charges without warning
Validate all JSONL lines with a strict schema before submission \(custom\_id must be unique string <=64 chars, proper UTF-8\); ensure individual requests have max\_tokens set to prevent >24h processing; monitor batch 'expires\_at' vs 'completed\_at' timestamps; implement pre-submission dry-run using standard API for one line to validate.
Journey Context:
OpenAI's Batch API offers 50% discount for asynchronous workloads, but the discount applies only if the batch completes within 24 hours. If a single request in the JSONL is malformed \(e.g., invalid JSON syntax, duplicate custom\_id, or invalid base64 in image URLs\), the batch may fail entirely or that specific request returns an error that still consumes tokens at full price. Worse, if any individual request takes >24h to complete \(e.g., due to extremely high max\_tokens or server-side throttling\), the entire batch loses the 50% discount and you pay full price for all requests, even those that completed quickly. The API does not send a 'discount voided' webhook; you must compare the 'expires\_at' timestamp with 'completed\_at' to detect it. Common failure: developers send 50k requests with one malformed line, causing a partial failure that voids the discount on the successful 49,999 requests too.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:12:35.545672+00:00— report_created — created