
Schema Generator API
Generate schemas in any programming language instantly. Convert data structures to TypeScript, Python, Java, and more with AI-powered analysis.
Send your API key in the Authorization header as a Bearer token (Authorization: Bearer YOUR_API_KEY) or in the X-API-Key header.
10 requests per minute
1 endpoint available
Overview
Send sample data (usually JSON) and a target language, and get back type definitions for it: a TypeScript interface, JSON Schema, Python class, Go struct and so on.
Notes
datais up to 20,000 characters. Send a representative sample, not a whole dataset.languagemust be one of the listed values and defaults totypescript.schemais code only, though the model sometimes wraps it in a markdown code fence.
This endpoint calls an AI model, so it uses the AI rate limit: 10 requests per minute and 200 requests per day per API key. Output is generated by a model and can be wrong, so review it before you use it.
Endpoints
https://opentools.ca/api/v1/tools/schema-generatorRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | Required | Sample data to describe, usually JSON. 1-20,000 characters. |
| language | string Enum: typescript, json-schema, python, java, csharp, go, rust, kotlin, swift, php | Optional | Target language for the schema.Default: typescript |
Response Example
{
"success": true,
"language": "typescript",
"schema": "interface User {\n id: number;\n name: string;\n email: string;\n tags: string[];\n}"
}Error Codes
Code Examples
curl -X POST https://opentools.ca/api/v1/tools/schema-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": "{\"id\": 1, \"name\": \"Ada\", \"email\": \"ada@example.com\", \"tags\": [\"admin\"]}",
"language": "typescript"
}'Rather use it in your browser? Open the Schema Generator