Structured Output JSON Schema Generator
Define the JSON shape you want a model to return once, then copy the provider-correct structured-output config for OpenAI response_format, Gemini responseSchema and Claude tool use. Strict-mode rules applied for you. No API key, no signup, runs in your browser.
How it works
Three providers solve the same problem — making a model return parseable JSON instead of free-form prose — but each names and shapes the configuration differently. This generator splits the job into two deterministic steps: build one canonical JSON Schema from your fields, then apply each provider's documented rules to it.
The canonical schema is always an object — { type: "object", properties, required } — because OpenAI and Gemini both reject a non-object root. An enum field becomes { "type": "string", "enum": [...] }, and an array of strings becomes { "type": "array", "items": { "type": "string" } }. You can also paste a sample JSON object (types are inferred from the values) or a TypeScript interface (the ? marker maps to optional).
For OpenAI the generator follows the Structured Outputs rules: the schema is wrapped as { type: "json_schema", json_schema: { name, strict: true, schema } }, every object gets additionalProperties: false, and every property is promoted into required. Because strict mode forbids optional fields, any field you left optional is re-typed as a nullable union such as ["string", "null"].
For Gemini the same schema is emitted as the OpenAPI subset under generationConfig.responseSchema, with responseMimeType: "application/json". Gemini does not support additionalProperties, so it is dropped; field order is pinned with propertyOrdering and optional fields are marked nullable: true. For Claude, which has no response-format parameter, the schema becomes a single forced tool — input_schema plus tool_choice: { type: "tool", name } — or an assistant prefill of {.
Generation is referentially transparent: identical inputs always produce byte-identical output. Two checks back the credibility badge — after the OpenAI transform the tool asserts every object really has additionalProperties: false and a complete required list, and the Gemini output is checked to carry no additionalProperties with a propertyOrdering matching your declared order. The page also counts nesting depth (max 5) and total properties (max 100) against OpenAI's documented ceilings.
Worked examples
Frequently asked questions
Sources & references
- OpenAI — Structured Outputs guide
- Google — Gemini API structured output (responseSchema)
- Anthropic — Tool use (Claude Messages API)
- Anthropic — Increase JSON output consistency
- JSON Schema — Draft 2020-12 core specification
Each provider's transform rules were last cross-checked against the official docs on 2026-06-30. Provider limits and keywords change — the generator is updated when they do, but always confirm against the current docs for production code.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want a provider or schema keyword added?
Email me at [email protected] — most fixes ship within 24 hours.