Enforcing a JSON schema on OpenAI Responses API output
OAI-SE
Structured Outputs & Strict JSON Schemas
Medium
Question 11 of 24
Thorne Reconciliation parses model output into a payments table on gpt-5.6-terra using the Responses API. The parser fails on Markdown code fences and on records missing the invoice_id field.
Which configuration enforces the schema on a completed, non-refusal response?
Show answer and explanation
Atext.format json_schema, strict true, additionalProperties false, every field required
On the Responses API structured output is configured under text.format, and strict mode requires additionalProperties false on every object with every property listed in required, which is what guarantees the shape on a completed, non-refusal response. additionalProperties true is rejected under strict, listing only invoice_id in required is rejected for the same reason, and response_format is the Chat Completions field and is not read on a Responses request.
Source: developers.openai.com/
Anonymous, no account needed. Your tally stays in this browser.
Practice by topic: Prompt engineering questions