{"uid":"cap_27dTY_tzY87Y_P6xREPIi","slug":"fastx402-typescript-type-inferrer-3670083e","name":"FastX402 TypeScript Type Inferrer","description":"216 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.","url":"https://fastx402.tools/typescript-infer?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"],"type":"string"},"queryParams":{"type":"object","required":["json"],"properties":{"json":{"type":"string","description":"JSON sample data to infer types from"},"name":{"type":"string","description":"Name for the generated type (default: Root)"},"style":{"type":"string","description":"Output style: interface or type (default: interface)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"name":{"type":"string"},"style":{"type":"string"},"typescript":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"name":"User","style":"interface","typescript":"interface User {\n  id: number;\n  name: string;\n  tags: string[];\n  meta: {\n    active: boolean;\n  };\n}"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SBllbXwO8JM0vN1akRtnS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Infers TypeScript interface or type alias definitions from a JSON sample, including nested structures and array types.","exampleAgentPrompt":"Can you infer a TypeScript interface called UserProfile from this JSON sample: {\"id\":1,\"name\":\"Alice\",\"email\":\"alice@example.com\",\"address\":{\"city\":\"NYC\",\"zip\":\"10001\"},\"tags\":[\"admin\",\"user\"]}?","exampleUseCases":[{"title":"Type-safe API response modeling","prompt":"I got this JSON back from a REST API and I need a TypeScript interface for it — can you infer the types? Here's the sample: {\"orderId\":\"abc123\",\"items\":[{\"sku\":\"XYZ\",\"qty\":2,\"price\":9.99}],\"total\":19.98,\"shipped\":false}. Name it OrderResponse."},{"title":"Auto-generate types for config object","prompt":"I have this config JSON and I want a TypeScript type alias (not an interface) called AppConfig so I can use it safely in my codebase: {\"theme\":\"dark\",\"maxRetries\":3,\"features\":{\"beta\":true,\"analytics\":false}}."},{"title":"Nested JSON schema typing for data pipeline","prompt":"Here's a complex nested JSON from our data pipeline — can you generate a TypeScript interface called PipelineEvent with all nested structures and array types properly typed? {\"eventId\":\"e1\",\"timestamp\":1700000000,\"payload\":{\"source\":\"kafka\",\"records\":[{\"key\":\"k1\",\"value\":42}]}}"}],"resultDescription":"Returns the inferred TypeScript type definition as a string, including the type name, output style used (interface or type alias), and the full TypeScript code with nested object types and array element types properly annotated.","failureModes":["Invalid or malformed JSON input causes inference failure","Empty JSON object results in minimal or trivial type output","Deeply recursive or circular JSON structures may produce incomplete types","Missing required 'json' query parameter returns an error","Ambiguous union types in JSON arrays may default to a broad type like 'any' or 'unknown'"],"whenToPreferThis":"Choose this endpoint when you need to quickly bootstrap TypeScript type definitions from real JSON data — particularly useful when dealing with API responses, configuration objects, or data pipeline payloads where writing types by hand would be tedious. Prefer this over manual type authoring or LLM-generated types when you want a deterministic, structured output with proper nested and array type handling at very low cost ($0.002/call).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T19:22:32.348Z","isFirstParty":false,"canonicalSlug":"fastx402-typescript-type-inferrer-3670083e"}