{"uid":"cap_0k2F--axegQgEg1rX4z_g","slug":"api-strale-io-d46a99c0","name":"JSON to Zod Schema Converter","description":"Convert JSON to Zod validation schemas. Auto-detects emails, URLs, UUIDs, dates for refined validators. Algorithmic.","url":"https://api.strale.io/x402/json-to-zod?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"},"root_name":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"json":"{\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"email\":\"test@example.com\",\"createdAt\":\"2024-01-15T10:30:00Z\",\"website\":\"https://example.com\"}}","root_name":"UserSchema"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0xf48686df181e86e29cf056e2c1965dd40baf8a120b744cc89b7cbce95d295ecf"},"capability":"json-to-zod","latency_ms":1,"provenance":{"source":"algorithmic","fetched_at":"2026-06-13T04:25:12.248Z"}},"zod_schema":"import { z } from \"zod\";\n\nconst userSchemaSchema = z.object({\n  user: userSchema,\n});\n\nconst userSchema = z.object({\n  id: z.string().uuid(),\n  email: z.string().email(),\n  createdAt: z.string().datetime(),\n  website: z.string().url(),\n});","root_schema":"userSchemaSchema","schema_count":2}},"exampleRequest":{"json":"{\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"email\":\"test@example.com\",\"createdAt\":\"2024-01-15T10:30:00Z\",\"website\":\"https://example.com\"}}","root_name":"UserSchema"},"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_4iqNi8QV8exGq_CF80tLp","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 JSON string into a Zod TypeScript validation schema, with automatic detection of emails, URLs, UUIDs, and dates for refined validators.","exampleAgentPrompt":"Convert this JSON to a Zod schema named UserSchema: {\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"email\":\"test@example.com\",\"createdAt\":\"2024-01-15T10:30:00Z\",\"website\":\"https://example.com\"}} — make sure it detects the UUID, email, date, and URL automatically.","exampleUseCases":null,"resultDescription":"Returns a Zod schema as a TypeScript string with refined validators automatically applied for detected email addresses, URLs, UUIDs, and ISO date strings, plus the root schema name.","failureModes":["Missing required 'json' query parameter returns an error","Invalid or malformed JSON input causes a parsing failure","Payment not provided results in a 402 Payment Required response with accepted payment details","Extremely large or deeply nested JSON may be truncated or cause timeout"],"whenToPreferThis":"Use this endpoint when you need to quickly scaffold Zod validation schemas from example JSON data, especially when the JSON contains emails, URLs, UUIDs, or dates that benefit from automatic refinement detection. Ideal for TypeScript/Node.js projects that use Zod for runtime validation and want to avoid writing boilerplate schema code by hand.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:48:22.231Z","isFirstParty":false,"canonicalSlug":"api-strale-io-d46a99c0"}