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.