AI Pulse by Inblix

OpenAI's API Guarantees Perfect JSON Schema Matching

OpenAI Blog · Jul 16, 2026 · 2 min read · Read original article →

Curated by the Inblix editorial team


Featured image for article: OpenAI's API Guarantees Perfect JSON Schema Matching

OpenAI just flipped a switch that makes one of the messiest parts of building with LLMs suddenly boring—in the best possible way. The company is rolling out Structured Outputs in its API, a feature that guarantees a model’s response will exactly match a developer-supplied JSON Schema. This isn’t just a minor tweak to prompt engineering. It’s a hard constraint baked into the system, and the numbers back it up.

On internal evaluations of complex schema following, the new gpt-4o-2024-08-06 model with Structured Outputs scores a perfect 100%. For context, the older gpt-4-0613 limps along at under 40%. That’s not an incremental gain—that’s the difference between a tool you have to babysit and one you can actually trust in a production pipeline. Developers have been kludging together workarounds for years, using open-source tooling, elaborate prompts, and retry loops to hammer model outputs into the right shape. Now the API itself handles the constraint.

The feature works in two ways. For function calling, adding strict: true to a tool definition forces model outputs to match it, and this works with all models that support tools going back to gpt-4-0613. There’s also a new json_schema option for the response_format parameter, which is useful when the model is just responding to a user structurally rather than calling a function. That second path is only available for the newest GPT-4o models released today.

OpenAI is clearly aware that determinism and safety can clash. The system still allows a model to refuse an unsafe request, and a new refusal string value in API responses lets developers programmatically detect that instead of crashing on malformed JSON. The Python and Node SDKs have been updated with native support too, so supplying a Pydantic or Zod object handles the conversion and deserialization automatically. It’s the kind of plumbing that makes the feature feel less like a research paper and more like a real product.

💡 Key Takeaways

  1. The new gpt-4o-2024-08-06 achieves a 100% reliability score on OpenAI's complex JSON schema evals, a massive jump from the sub-40% performance of gpt-4-0613.
  2. Structured Outputs work via a `strict: true` flag for function calling across all tool-supporting models, and a separate `json_schema` response format exclusive to the latest GPT-4o models.
  3. OpenAI built a deterministic engineering constraint on top of model training to hit 100% reliability, acknowledging that non-deterministic model behavior alone wasn't enough for production applications.
  4. A new `refusal` string in API responses lets developers programmatically handle safety refusals without their entire pipeline breaking due to unexpected output formats.

Keep reading: See related articles below for more coverage on this topic.

Get smarter about AI

The sharpest AI news, curated daily. Delivered free to your inbox.

Learn more

Glossary terms

← Back to all articles