Well that is sometimes tricky - in my case (also with 4.1) it is about 1 in 10-20 AND on retry it happens again. Structured output with responses API returns tons of \n\n\n\n - #2 by OnceAndTwice oh and it takes a minute or so to come the (broken) result.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| ModelBehaviorError: Invalid output type | 9 | 765 | July 16, 2025 | |
| Invalid JSON response when using Structured Output | 4 | 1717 | February 16, 2025 | |
| Fine-tune 4o model - endless inference for JSON | 6 | 323 | April 18, 2025 | |
| Structured model outputs (Responses API) returning invalid JSON 80% of the time | 5 | 206 | March 29, 2026 | |
| Clarity on gpt-4.1 and o4-mini structured output support | 8 | 7722 | May 20, 2025 |