Users Pricing

forum

Home Forums How should OpenAI strict structured outputs handle optional fields? – MindStick

How should OpenAI strict structured outputs handle optional fields?

Gabriela Gómez 73 15 Oct 2026

I’m building an API response schema where a few fields are optional, but I want the model to follow the schema reliably rather than return slightly different JSON on each request.

With strict structured outputs, is it better to represent an absent value as null, or design the schema so the field can be omitted? I’m also curious how people manage schema changes when older clients still expect the previous response shape.

If you’ve shipped this in production, what approach has been least brittle?


0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md