New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
The schema that works fine against one provider gets rejected outright the moment I point the same request at the other.
What you'll have at the end
One schema file that both providers' strict-mode validators accept, with a short note on what had to change
You need
A JSON Schema already wired into one provider's strict or structured-output call, OpenAI's strict: true or Claude's output_config.format or a strict tool, with at least one property carrying a pattern or a length or range keyword, plus the ability to call both providers' APIs directly.
Not covered
Getting the model's own extracted values right once the schema is accepted; this only makes the schema itself pass both validators.
Leans on
Your Pydantic model fails OpenAI's strict mode
your model already passes OpenAI's own strict-mode rules, and you haven't yet checked it against Claude's separate, stricter keyword subset.
Resubmit a rejected reply with the schema error attached
the schema itself now passes both validators, but the model's actual reply still gets a field wrong and you want it to see the error and retry.
Checked 15 Aug 2026
Part of the Structured Output Generation with LLMs cookbook