Skip to content
llmconsole

JSON Schema Generator

Paste sample JSON; get an OpenAI-strict or Anthropic-tool schema with the structured-output gotchas handled.

{
  "name": "response",
  "strict": true,
  "schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "user_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "age": {
        "type": "integer"
      },
      "is_premium": {
        "type": "boolean"
      },
      "tags": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "address": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        },
        "required": [
          "city",
          "country"
        ],
        "additionalProperties": false
      },
      "scores": {
        "type": "array",
        "items": {
          "type": "integer"
        }
      }
    },
    "required": [
      "user_id",
      "name",
      "age",
      "is_premium",
      "tags",
      "address",
      "scores"
    ],
    "additionalProperties": false
  }
}
Target notes
  • OpenAI strict: wraps in { name, strict: true, schema: {...} } ready to drop into response_format. Requires additionalProperties: false and every property to be in required.
  • Anthropic tool: bare JSON Schema 2020-12 that you can paste directly into the input_schema field of a tool definition.
  • Draft-07: classic JSON Schema with the older $schema; broader compatibility outside LLM use cases.
  • Inference assumes arrays are homogeneous and infers the item type from the first element. Edit the output before shipping if your data is more varied.