JSON Schema Generator
Infer a JSON Schema from a sample object to start from.
Strict structured outputs and strict tool calling are now the default way to get reliable JSON out of an LLM — but OpenAI and Anthropic enforce <em>different</em> rules on the JSON Schema you give them, and a schema that works on one is often rejected by the other. This tool checks your schema against each provider's strict-mode constraints and tells you exactly what would fail and why, before you waste an API call. It runs entirely in your browser.
Structured outputs constrain an LLM to emit JSON that conforms exactly to a schema, which is why they have become the standard way to get machine-readable output instead of parsing prose. The catch is that providers only accept a subset of JSON Schema in strict mode, and that subset is not the same across providers. A schema that OpenAI happily accepts can be rejected by Anthropic, and vice versa, so a tool that works against one model breaks when you switch.
The rules fall into two buckets. The first is structural and shared: every object must set additionalProperties to false, and every property effectively has to be declared — OpenAI requires all properties to appear in the required array (you mark a field optional by making it nullable), while Anthropic automatically treats every non-nullable property as required. The second bucket is constraint keywords, and this is where the providers diverge most. OpenAI accepts keywords like pattern, format, minLength, and minimum but does not enforce them, so they silently do nothing; Anthropic rejects minimum, maximum, multipleOf, minLength, and maxLength with an error. OpenAI additionally limits nesting to five levels and forbids a root-level anyOf, while Anthropic limits how many optional and union-typed parameters a schema may have and does not support external references or recursive schemas.
Because these constraints are documented but easy to miss, the failure mode is an opaque API error after you have already built and shipped the tool. Checking the schema locally first — flagging every rejection and every silently-ignored keyword before the first request — turns a frustrating round-trip into a quick edit. Pair this with a generator if you are building the schema from scratch.
json_schema structured outputs (and strict: true on tools); Anthropic calls it Structured Outputs and strict tool use. It is the production default for getting reliable JSON — but the provider only accepts a restricted subset of JSON Schema, and an invalid schema is rejected with an API error instead of silently working.additionalProperties: false on every object and effectively require every property to be listed (OpenAI requires all properties in required; make optional fields nullable; Anthropic treats every non-nullable property as required). The big differences are in constraint keywords: OpenAI accepts but does not enforce pattern, format, minLength, minimum and similar, so they silently do nothing; Anthropic rejects minimum, maximum, multipleOf, minLength and maxLength outright. OpenAI also caps nesting at 5 levels and forbids a root anyOf; Anthropic caps optional and union-typed parameter counts and forbids external $ref and recursive schemas.additionalProperties: false; properties that are not required (with the right fix for each provider); constraint keywords that the provider ignores (OpenAI) or rejects (Anthropic); disallowed types; a root anyOf and over-deep nesting (OpenAI); external $ref, bad minItems, and the optional / union parameter limits (Anthropic). Errors are things that will cause a rejection; warnings are things that work but behave differently than you might expect.additionalProperties: false; an optional property that is not in required (OpenAI) or not made nullable (Anthropic); a numeric or string constraint like minimum or maxLength that Anthropic does not support; a root schema that is anyOf (OpenAI); or nesting deeper than five levels (OpenAI). Paste your schema above and the validator pinpoints each one. These rules are verified against the providers' docs as of mid-2026 but can change — confirm against the official documentation.