JSON schema and tool definition for AI
List your fields once: you get the JSON schema and its exact version for OpenAI, Claude and Gemini, as a tool or as structured output.
Fields
Result
Tool or structured output?
- A tool (function calling, tool use) describes an action the model can request: look up an order, send an email. The model returns the name of the tool and its arguments; your code is what runs it.
- A structured output forces the shape of the reply itself: a JSON object that matches your schema, ready to be saved to a database.
- Strict mode guarantees that the reply follows the schema. It requires additional properties to be disallowed; at OpenAI, all fields must be required, and an optional field is declared by allowing a null value.
Where to put the schema
| API | Tool | Structured output |
|---|---|---|
| OpenAI | tools : type function, name, parameters, strict | text.format of type json_schema |
| Claude | tools : name, description, input_schema, strict | output_config.format of type json_schema |
| Gemini | tools : functionDeclarations | generationConfig : responseMimeType and responseSchema |
The description of each field matters as much as its type: it is what the model reads to decide what to put in it. API formats change; check the provider documentation before going to production.
How to use the JSON schema generator for AI
Your fields, described once, turned into the format of OpenAI, Claude and Gemini.
-
List the fields
Name, type, description, required or not; or paste an example JSON.
-
Choose the use
Tool definition or structured output, in strict mode or not.
-
Copy the JSON
The schema alone, or a block ready to place in each API’s request.
About the JSON schema generator for AI
Getting reliable JSON out of a model goes through a schema: the list of fields, their type and their description. The three major APIs accept one, but not in the same place or with the same rules. In strict mode OpenAI requires every field to be required, an optional field becoming “text or null”; Claude expects the schema under input_schema; Gemini under functionDeclarations, without the additionalProperties key.
The tool applies these differences for you and flags common mistakes: duplicate field, a name with a space or an accent, an empty list of values, a missing description. Starting from an example JSON lets you infer the fields and their types in one click.
Frequently asked questions about the JSON schema generator for AI
What is function calling?
A mechanism by which the model, instead of answering in text, asks for a function you described to be run, supplying its arguments as JSON. Your code runs it and returns the result.
What does strict mode bring?
The guarantee that the arguments or the response match the schema exactly: no missing field, no wrong type.
Are nested objects supported?
The editor handles simple fields, lists and enumerations. For a nested object, generate the schema and then complete it by hand.
Is my schema sent anywhere?
No, it is built in your browser and kept only in its local storage.
Is it free?
Yes, with no sign-up and no usage limit.