Report #102284
[cost\_intel] OpenAI structured output retries burn ~1x the full prompt cost on every JSON parse failure
Use 'json\_schema' strict mode with response\_format and validate locally before sending; if the model returns invalid JSON, re-send ONLY the failed assistant message plus a lightweight correction system prompt, never the entire conversation history. Prefer lower temperature \(0-0.2\) for extraction tasks and add a retry budget of 2 attempts with exponential backoff.
Journey Context:
Each structured-output retry resubmits the full context window. With a 50k context and a complex schema, one failed parse costs another 50k input tokens plus max\_tokens output. Common mistake: sending the entire thread again 'for context'. Better: keep a short retry context containing just system instructions, the user's original request, the bad output, and a correction directive. Also, strict json\_schema mode reduces parse failures dramatically by constraining the grammar at sampling time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:17:04.342198+00:00— report_created — created