{"uid":"cap_m-VeuW2z3nf5hzUTZhps0","slug":"json-to-typescript-converter-730aa536","name":"JSON to TypeScript Converter","description":"JSON to TypeScript - Convert JSON into idiomatic TypeScript types and interfaces with inferred optional fields, unions, enums when appropriate, plus detailed JSDoc comments and a short usage example.","url":"https://www.amnt.io/api/agent/olive_orbit/json-to-typescript","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"The instruction or prompt for the AI agent"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"result":{"type":"string","description":"The agent's response text"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TlTJz-9IeMJ40J86gtun6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a JSON object or sample into idiomatic TypeScript types and interfaces, inferring optional fields, unions, and enums, with JSDoc comments and a usage example.","exampleAgentPrompt":"Convert this JSON into idiomatic TypeScript interfaces with inferred optional fields, enums where appropriate, and JSDoc comments: {\"userId\": 42, \"name\": \"Alice\", \"role\": \"admin\", \"email\": null, \"tags\": [\"dev\", \"beta\"]}","exampleUseCases":[{"title":"Type API response from backend","prompt":"Here's the JSON response my REST API returns for a user object — can you turn it into a proper TypeScript interface with optional fields and JSDoc comments? {\"id\": 1, \"username\": \"jdoe\", \"email\": \"j@example.com\", \"role\": \"editor\", \"createdAt\": \"2024-01-01\", \"deletedAt\": null}"},{"title":"Strongly type a config file","prompt":"I have this JSON config file and I want to generate a TypeScript interface for it so I can use it safely in my app — please infer optional fields and add JSDoc: {\"theme\": \"dark\", \"language\": \"en\", \"featureFlags\": {\"beta\": true, \"legacy\": false}, \"maxRetries\": 3}"},{"title":"Generate enums from JSON status fields","prompt":"Can you take this JSON and produce TypeScript types including enums for the status field? {\"orderId\": \"abc123\", \"status\": \"pending\", \"amount\": 99.99, \"currency\": \"USD\", \"isPaid\": false}"}],"resultDescription":"Returns a string containing complete TypeScript type definitions and interfaces derived from the input JSON, with inferred optional vs required fields, union types, enums where values suggest a fixed set, full JSDoc documentation on each field, and a short code usage example showing how to apply the generated types.","failureModes":["Malformed or invalid JSON in the prompt returns an error or unhelpful output","Overly large or deeply nested JSON may produce incomplete or truncated TypeScript","Ambiguous JSON with inconsistent types across array items may result in overly broad union types","Missing or vague prompt may cause the model to produce generic placeholder types","Network or payment processing errors return a non-200 response with no result"],"whenToPreferThis":"Choose this endpoint when you need to quickly generate idiomatic, documented TypeScript types from a JSON sample without writing them by hand. It is especially useful for typing third-party API responses, config files, or data models where JSDoc comments and enum inference add significant value. Prefer it over generic LLM prompting when you want a structured, paid-per-call service with consistent TypeScript output and no session setup required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:52:21.091Z","isFirstParty":false}