{"name":"type-inference-from-json","description":"Infers type definitions from a JSON sample, converting JSON to TypeScript, Zod, or JSON Schema. Paste a sample (or array of samples); returns a generated type definition in your chosen format. Merges across array elements / object samples: properties present in some but not all become optional, mixed primitive types become unions. Auto-detects string formats (date-time / uuid / uri / email) for richer outputs. Ideal inside agent code-gen loops that need to consume an unfamiliar API response. Use it as a JSON shape inferer or quicktype-style type generator.","price":"$0.005","method":"POST","input_schema":{"properties":{"json":{"type":["string","object","array","number","boolean","null"],"description":"The JSON sample to infer from. Accept a JSON string OR a pre-parsed object/array/primitive. Max 256 KB if passed as string."},"format":{"type":"string","enum":["typescript","zod","jsonschema"],"description":"Output format. Default 'typescript'."},"root_name":{"type":"string","description":"Name of the root type / interface / Zod export. Must be a valid JS identifier. Default 'Root'."},"date_strings":{"type":"boolean","description":"If true (default), recognize ISO-8601 date-time / UUID / URL / email strings and emit format-aware types. Set false to treat all strings as plain 'string'."}},"required":["json"]},"input_example":{"json":{"id":7,"name":"Ada","tags":["a","b"],"joined_at":"2025-01-02T03:04:05Z"},"format":"typescript"},"output_example":{"format":"typescript","root_name":"Root","types":"export interface Root {\n  id: number;\n  name: string;\n  tags: Array<string>;\n  joined_at: string;\n}\n","inferred_shape":{"id":"integer","name":"string","tags":["string"],"joined_at":"string<date-time>"},"source":"Inferred locally; no upstream call"},"x402_payment_required":true,"x402_facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}