{"uid":"cap_c1FUXojzwnQobpY5oRCD_","slug":"openverbs-format-infer-json-schema-f0114462","name":"OpenVerbs Format: Infer JSON Schema","description":"Infer a JSON Schema (draft-07) from a sample document in any supported format. Types are inferred, present keys are marked required, and heterogeneous array item schemas are merged. The result validates out of the box with /v1/validate.","url":"https://format.openverbs.com/v1/infer-schema","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":["data"],"properties":{"data":{"type":"string","maxLength":1000000,"minLength":1,"description":"The sample document to infer a schema from, as a string in the `from` format."},"from":{"enum":["json","json5","jsonc","yaml","xml","csv","tsv","toml","ndjson","ini","env","properties","plist","querystring"],"type":"string","description":"Source format of `data`. Default json."}},"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_-xV6W3tdiLoaTpPx6-6Dn","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 (draft-07) from a sample document provided in any of 14 supported structured formats","exampleAgentPrompt":"Look at this sample JSON document and infer a draft-07 JSON schema from it — mark all present keys as required and merge any heterogeneous array item types: {\"name\":\"Alice\",\"age\":30,\"tags\":[\"admin\",\"user\"]}","exampleUseCases":[{"title":"Schema from API response sample","prompt":"I have a sample JSON response from an external API — can you infer a draft-07 JSON schema from it so I can use it to validate future responses? Here's the sample: {\"id\":\"abc123\",\"status\":\"active\",\"score\":0.95,\"roles\":[\"admin\"]}"},{"title":"Schema from YAML config file","prompt":"I've got a YAML config file and I need a JSON schema for it so I can validate configs programmatically — please infer the schema from this YAML sample: 'host: localhost\\nport: 5432\\nenabled: true'"},{"title":"Validate CSV structure with inferred schema","prompt":"Can you generate a JSON schema from this CSV sample so I can use it to validate new CSV uploads? The sample is: 'name,age,email\\nAlice,30,alice@example.com\\nBob,25,bob@example.com'"}],"resultDescription":"A JSON Schema (draft-07) object derived from the provided sample document. All keys present in the sample are marked as required, types are inferred from actual values, and heterogeneous array item schemas are merged into a unified schema. The result is compatible with the /v1/validate endpoint on the same service.","failureModes":["Invalid or malformed input document — returns error if the document cannot be parsed in the specified format","Unsupported format specified — only the 14 enumerated formats are accepted","Empty data field — minLength:1 enforced, empty strings will be rejected","Extremely large documents exceeding 1,000,000 characters — rejected by maxLength constraint","Format mismatch — specifying 'yaml' for a JSON document may still work but specifying 'csv' for nested JSON will fail","Payment failure — x402 payment of $0.004 USDC must succeed before the request is processed"],"whenToPreferThis":"Choose this endpoint when you need to automatically derive a JSON Schema (draft-07) from an existing sample document without writing the schema by hand. It is especially useful when the source document is in a non-JSON format (YAML, CSV, TOML, XML, etc.) since it handles cross-format inference natively. It pairs naturally with the sibling /v1/validate endpoint on the same service. Prefer this over manual schema authoring or LLM-generated schemas when you need a deterministic, structurally accurate schema that faithfully reflects your sample data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:37.811Z","isFirstParty":false}