{"uid":"cap_F8rwn9pSdEe1aCJMoRfxZ","slug":"api-strale-io-3f486fee","name":"JSON to TypeScript Interface Converter","description":"Convert JSON to TypeScript interfaces. Handles nested objects, arrays, optional fields. Detects date strings and UUIDs. Algorithmic.","url":"https://api.strale.io/x402/json-to-typescript?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["json"],"properties":{"json":{"description":"JSON string or object"},"export":{"type":"boolean"},"root_name":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"json":"{\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"name\":\"Alice\",\"createdAt\":\"2024-01-15T10:00:00Z\",\"address\":{\"city\":\"Berlin\",\"zip\":\"10115\"}}}","export":true,"root_name":"User"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0x22d86d6bc7fa3cd4144e78e10aca0a3a4c8b6580640bd19398f5218c62b14d37"},"capability":"json-to-typescript","latency_ms":0,"provenance":{"source":"algorithmic","fetched_at":"2026-06-16T01:24:45.622Z"}},"root_type":"User","typescript":"export interface User {\n  user: UserUser;\n}\n\nexport interface UserUser {\n  id: string;\n  name: string;\n  createdAt: string /* ISO date */;\n  address: UserUserAddress;\n}\n\nexport interface UserUserAddress {\n  city: string;\n  zip: string;\n}","interface_count":3}},"exampleRequest":{"json":"{\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"name\":\"Alice\",\"createdAt\":\"2024-01-15T10:00:00Z\",\"address\":{\"city\":\"Berlin\",\"zip\":\"10115\"}}}","export":true,"root_name":"User"},"tags":["x402"],"displayCostAmount":"0.054001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mV9ILR3ilf309p500vJPj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a JSON object or string into TypeScript interfaces, handling nested objects, arrays, optional fields, date strings, and UUIDs.","exampleAgentPrompt":"Can you convert this JSON into TypeScript interfaces for me: {\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"name\":\"Alice\",\"createdAt\":\"2024-01-15T10:00:00Z\",\"address\":{\"city\":\"Berlin\",\"zip\":\"10115\"}}} — name the root interface 'User' and include export keywords.","exampleUseCases":null,"resultDescription":"Returns TypeScript interface declarations for the provided JSON, with nested object types, arrays typed appropriately, optional fields marked with '?', date strings inferred as Date types, and UUIDs noted. If 'export' is requested, interfaces are prefixed with the export keyword. The root interface uses the supplied root_name or a default name.","failureModes":["Invalid or malformed JSON input returns an error","Missing required 'json' query parameter returns a 400-level error","Extremely deeply nested or circular JSON structures may produce incomplete output","Non-JSON string passed as input fails to parse"],"whenToPreferThis":"Choose this endpoint when you need fast, algorithmic TypeScript interface generation from a JSON payload without sending data to an LLM. It is ideal for typed API client generation, auto-documenting REST response shapes, or scaffolding TypeScript models from sample data. Prefer it over LLM-based approaches when consistency, speed, and determinism matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:56:08.573Z","isFirstParty":false,"canonicalSlug":"api-strale-io-3f486fee"}