{"uid":"cap_rRJ9Um3eIWL3DF35vaZ5_","slug":"json-schema-inference-api-f806afcf","name":"JSON Schema Inference API","description":"Infer a JSON Schema (draft-07) from an example value, walking objects and arrays recursively. Set detectFormat=true to tag strings that look like date-time/date/email/uri/uuid, requireAll=false to leave object properties optional, and additionalProperties=true to allow extra keys.","url":"https://jsonschema.openverbs.com/v1/infer","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":["sample"],"properties":{"sample":{"description":"An example value to infer a schema from (any JSON type)."},"requireAll":{"type":"boolean","description":"Mark all object properties as required. Default true."},"detectFormat":{"type":"boolean","description":"Tag recognizable string formats (date-time/date/email/uri/uuid). Default false."},"additionalProperties":{"type":"boolean","description":"Allow properties beyond those seen. Default false."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4Lw3Hey5Saul3grT1tPpt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Infers a JSON Schema from a provided sample JSON value, with options to control required fields, format detection, and additional properties","exampleAgentPrompt":"Take this sample JSON object — {\"userId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\", \"email\": \"user@example.com\", \"createdAt\": \"2024-01-15T10:30:00Z\", \"score\": 42} — and infer a JSON Schema from it, marking all fields as required and detecting string formats like date-time, email, and UUID.","exampleUseCases":[{"title":"API response schema documentation","prompt":"I have a sample API response JSON — {\"id\": 1, \"name\": \"Alice\", \"email\": \"alice@example.com\", \"createdAt\": \"2024-06-01\"} — can you infer a JSON Schema from it with format detection enabled so I can document my API?"},{"title":"Form data validation schema","prompt":"Here's an example form submission object: {\"username\": \"john_doe\", \"age\": 28, \"newsletter\": true}. Generate a JSON Schema from it with all properties marked as required and no additional properties allowed."},{"title":"Data pipeline input contract","prompt":"I need a strict JSON Schema for my data pipeline. Here's a representative sample record: {\"transactionId\": \"txn-001\", \"amount\": 99.99, \"currency\": \"USD\", \"timestamp\": \"2024-03-10T08:00:00Z\"}. Infer the schema, require all fields, detect formats, and disallow any extra properties."}],"resultDescription":"The endpoint returns an inferred JSON Schema (draft 2020-12) corresponding to the structure and types found in the provided sample. The schema includes type annotations for all detected fields, a required array if requireAll is true, string format tags (e.g. date-time, email, uri, uuid) if detectFormat is true, and an additionalProperties constraint if that option is set. The output is a machine-readable JSON Schema document ready for use in validation, documentation, or code generation.","failureModes":["Missing 'sample' field in body causes a validation error","Invalid or non-JSON body type causes parsing failure","Very deeply nested or extremely large JSON samples may hit processing limits","Ambiguous types (e.g. null values) may produce loose schemas with 'nullable' or missing type constraints","Non-JSON body type (form-data, text) submitted with a JSON sample may cause unexpected behavior"],"whenToPreferThis":"Choose this endpoint when you need to automatically generate a JSON Schema from an existing JSON sample — particularly useful for API documentation, data contract creation, or input validation setup. Prefer it over hand-writing schemas when you have a representative sample and want to avoid manual type annotation. It is especially useful when detectFormat is needed to auto-tag semantic string types like UUID, email, or ISO date. It is not suitable for validating existing data against an already-known schema, nor for transforming or processing JSON data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:34:25.658Z","isFirstParty":false}