11 APIs for the decisions an agent cannot afford to guess.
One payment rail. No account, no API key, no subscription. Every answer carries evidence you can check, and a failed call is never charged.
Two families. Guards answer whether an action is safe while it is still reversible — an unsigned Base transaction, a token approval, a payment destination, a PostgreSQL statement, a shell command. Resolvers turn ambiguous input into a checked answer — a document into schema-valid JSON, a local time into an exact instant, an untrusted page into clean text, an address or a receipt into decoded facts.
- Evidence, not confidence scores. Findings carry a stable code, a severity, and the decoded payload that produced them. A caller can act on "the tag block at offset 1841 decodes to ignore all previous instructions"; nobody can act on 0.87.
- "Unknown" is a real answer. It outranks a warning and is never quietly downgraded to allow. A preflight that cannot say "I do not know" converts absence of evidence into assurance of safety.
- Deterministic outside extraction. Nine of 11 routes run no model on any path, so the same input and declared data versions give a byte-identical answer, permanently.
- Nothing is retained. Caller content is processed in memory and never persisted. Analytics record non-content fields only.
The 11 APIs
Pick a row by what you are about to do. Every route is pay-per-call over x402 V2 with USDC on Base mainnet, needs no account and no API key, and settles only once it has produced a usable answer. This origin serves the two extraction routes; the other 9 run on their own subdomains and each stays authoritative for its own schemas, benchmarks, and payment manifest.
| API | Use when | Endpoint | Price | Brief |
|---|---|---|---|---|
| SchemaSure Text extraction | you hold unstructured text or HTML and need JSON that matches a schema you supply | POST /v2/extract | $0.02/call, flat, failed calls free | llms.txt |
| SchemaSure Image extraction | you hold a document image — scan, receipt, form, label, or screenshot — and need JSON that matches a schema you supply | POST /v2/extract-image | $0.06/image, flat, failed calls free | llms.txt |
| ChronoSure Business time | you must resolve a local time, a DST ambiguity, a business-day offset, or a public holiday for a timezone | POST /v1/business-timechrono.schemasure.com | $0.02/call list | llms.txt |
| SQLPermit SQL guard | you are about to execute a PostgreSQL statement and need it checked against a policy first | POST /v1/guard/sqlsqlpermit.schemasure.com | $0.02/call list | llms.txt |
| TxGuard Transaction preflight | you are about to sign a Base transaction or an x402 payment authorization and need to know what it actually does | POST /v1/tx/preflighttxguard.schemasure.com | $0.02/call list | llms.txt |
| SafeFetch Safe fetch | you must read an untrusted web page and want the prose without the instructions hidden inside it | POST /v1/fetchsafefetch.schemasure.com | $0.02/call list | llms.txt |
| ChainState Address state | you hold a Base address and need to know what it is before you touch it — contract or wallet, which token standard, what it is called, what it holds | POST /v1/chain/statechainstate.schemasure.com | $0.02/call list | llms.txt |
| PayeeGuard Payee guard | you are about to send funds and want the destination checked before the transfer becomes irreversible | POST /v1/guard/payeepayee.schemasure.com | $0.02/call list | llms.txt |
| AllowanceGuard Allowance guard | you are about to approve a token spender and need to know what that grant actually permits | POST /v1/guard/allowanceallowance.schemasure.com | $0.03/call list | llms.txt |
| ReceiptSure Receipt verification | a Base transaction has landed and you need to know whether it did what you intended, not merely that it succeeded | POST /v1/tx/receipt-verifyreceipt.schemasure.com | $0.02/call list | llms.txt |
| ShellPermit Shell guard | you are about to run a shell command and need it checked against a policy before it executes | POST /v1/guard/shellshellpermit.schemasure.com | $0.03/call list | llms.txt |
Prices shown as "list" are for orientation only; the authoritative amount always comes from that service's live 402 challenge. For a machine-readable index of every capability, read /apis.json or /SKILL.md.
Extraction, the two routes served from this origin
Everything below documents the two extraction routes only, because they are the ones hosted here. The other 9 APIs are documented at their own origins — follow the brief links in the table above rather than reading this section for them.
Send text, HTML, or a PNG/JPEG/WebP image plus your JSON Schema. Receive JSON that validates with Ajv draft 2020-12, or a typed error and you are not charged.
- Text/HTML evidence: Benchmarked 100% schema-valid with ~0.99 field F1 and zero hallucinations across a 10-doc-type text/HTML corpus (11 items, incl. an adversarial prompt-injection tier), p50 latency ~1.5s and p95 ~57.7s. Evidence: /.well-known/benchmarks.json.
- Image evidence: Five real paid image calls passed schema validation and all 148 independently transcribed field anchors across a synthetic invoice/receipt launch corpus, with p50 latency ~2.6s and p95 ~4.1s. Small-corpus limitations are published at /.well-known/image-benchmarks.json.
| Input | Use | Endpoint | Price |
|---|---|---|---|
| Text or HTML | Emails, pages, logs, OCR text, resumes, invoices | /v2/extract | $0.02/call, flat, failed calls free |
| Document image | Scans, receipts, forms, labels, screenshots, photos | /v2/extract-image | $0.06/image, flat, failed calls free |
PDFs and multi-image requests are not supported. Convert each page to PNG, JPEG, or WebP and call the image endpoint once per image.
Production API: V2
POST /v2/extract is the canonical SchemaSure API for production agents, integrations, and marketplace discovery. It is always paid from the first call and uses x402 V2 with USDC on Base mainnet (eip155:8453).
curl -i -X POST https://schemasure.com/v2/extract \
-H 'content-type: application/json' \
-d '{"input":"Invoice #A-1042 — Acme Corp. Total due: $1,299.00 USD on 2026-08-01.","schema":{"type":"object","additionalProperties":false,"required":["invoiceNumber","total","currency","dueDate"],"properties":{"invoiceNumber":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string","enum":["USD","EUR","GBP"]},"dueDate":{"type":"string","format":"date"}}}}'
V2 payment flow
- The unsigned request returns
402withPAYMENT-REQUIRED. - Validate the live price, network, asset, payee, and resource; sign them with an x402 V2 wallet/client.
- Retry the identical request with
PAYMENT-SIGNATURE. - On
200, readPAYMENT-RESPONSEfor the settlement receipt.
Do not hardcode payment terms—validate the live challenge. The server verifies before work and settles only after producing schema-valid output.
Document image extraction: V2 only
POST /v2/extract-image reads invoices, receipts, forms, labels, screenshots, and photographed documents into your JSON Schema. Send base64 PNG, JPEG, or WebP bytes. This service is always paid via x402 V2 from the first call—there is no free or V1 image endpoint.
IMAGE_BASE64=$(base64 < invoice.png | tr -d '\n')
curl -i -X POST https://schemasure.com/v2/extract-image \
-H 'content-type: application/json' \
-d '{"image":{"data":"'"$IMAGE_BASE64"'","mimeType":"image/png"},"schema":{"type":"object","required":["invoiceNumber","total"],"properties":{"invoiceNumber":{"type":"string"},"total":{"type":"number"}}}}'
Successful response (data validates against the schema supplied in the request):
{
"data": {
"invoiceNumber": "INV-2048",
"vendor": "Northstar Supplies",
"total": 382.45
},
"meta": {
"repairs": 0,
"latencyMs": 910,
"validated": true
}
}
Maximum decoded image size: 8 MiB. The declared MIME type must match the file signature. Clear, upright, high-resolution images work best.
Try free on legacy V1
Evaluate extraction quality without connecting a wallet: the legacy POST /extract endpoint includes 3 limited free calls per client. When you are ready to automate or increase usage, move the agent to V2.
curl -X POST https://schemasure.com/extract \
-H 'content-type: application/json' \
-d '{"input":"Invoice #A-1042 — Acme Corp. Total due: $1,299.00 USD on 2026-08-01.","schema":{"type":"object","additionalProperties":false,"required":["invoiceNumber","total","currency","dueDate"],"properties":{"invoiceNumber":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string","enum":["USD","EUR","GBP"]},"dueDate":{"type":"string","format":"date"}}}}'
| V1 evaluation | V2 production | |
|---|---|---|
| Endpoint | /extract | /v2/extract |
| Free calls | 3 limited calls/client | No—payment from first call |
| Recommended for | Trying SchemaSure | Production agents and marketplaces |
| Protocol | x402 V1 | x402 V2 |
Extraction pricing
- Text/HTML: $0.02/call, flat, failed calls free.
- Image: $0.06/image, flat, failed calls free. V2-only; no free image calls.
- Primary V2 API — USDC on Base mainnet. No signup, API keys, or account dashboard.
- Charge-only-on-success: verified up front, settled only after valid output is produced.
- Free evaluation calls are available only on the legacy V1 endpoint.
Why agents can trust extraction
Prompt-injection defenses
Document content is delimited and treated as data. The text benchmark includes an adversarial injection case; no defense is represented as universally infallible.
Typed errors
Machine-readable JSON with stable error codes — never an HTML page.
Validated output
Every result is checked against your JSON Schema with Ajv (draft 2020-12).
Modality-specific evidence
Inspect text/HTML metrics and paid image metrics, including sample sizes, latency tails, methodology, and limitations.
Extraction error handling and retry policy
| HTTP | Codes | Agent action |
|---|---|---|
| 400 / 413 | BAD_REQUEST, INVALID_SCHEMA, INPUT_TOO_LARGE, UNSUPPORTED_INPUT_TYPE | Fix or reduce the request. Do not retry it unchanged. |
| 402 | PAYMENT_REQUIRED, PAYMENT_INVALID | Validate and sign the live challenge, or obtain a fresh challenge. Retry the identical body only. |
| 422 | EXTRACTION_FAILED, VALIDATION_FAILED, ABSTAINED | Change the input/schema or use a fallback. No settlement occurs. |
| 429 | RATE_LIMITED | Wait for Retry-After. |
| 500 / 502 / 504 | INTERNAL, UPSTREAM_LLM_ERROR, PAYMENT_UPSTREAM, TIMEOUT | Retry with bounded exponential backoff. Include X-Request-ID in support reports. |
Every error is JSON: {"error":{"code":"...","message":"...","details":{...}}}. Do not blindly replay a paid request after losing its response; request idempotency is not yet available.
Text V2 request & response example
Canonical request body for /v2/extract:
{
"input": "Invoice #A-1042 — Acme Corp. Total due: $1,299.00 USD on 2026-08-01.",
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"invoiceNumber",
"total",
"currency",
"dueDate"
],
"properties": {
"invoiceNumber": {
"type": "string"
},
"total": {
"type": "number"
},
"currency": {
"type": "string",
"enum": [
"USD",
"EUR",
"GBP"
]
},
"dueDate": {
"type": "string",
"format": "date"
}
}
}
}
Response (data validates against your schema; meta reports repairs and latency):
{
"data": {
"invoiceNumber": "A-1042",
"total": 1299,
"currency": "USD",
"dueDate": "2026-08-01"
},
"meta": {
"repairs": 0,
"latencyMs": 640,
"validated": true
}
}
Best results come from describing your fields: a per-field description in your schema is the biggest accuracy lever. Max input 256 KB per call.
Extraction via MCP
Machine-readable discovery surfaces:
/llms.txt /SKILL.md /openapi.json /.well-known/x402 /.well-known/x402-image /.well-known/x402-v1 /.well-known/pricing.json /.well-known/benchmarks.json /.well-known/image-benchmarks.json /apis.json /.well-known/security.txt /.well-known/data-handling.json
MCP: run npx -y @noamjose/schemasure. The published thin client exposes extract_to_schema and extract_image_to_schema; set SCHEMASURE_PRIVATE_KEY for paid x402 V2 mode. The dedicated wallet signs locally and the key never reaches SchemaSure. Package and setup.
Data handling: production does not persist raw text, HTML, images, schemas, or extracted output. /metrics is an ephemeral per-process operational snapshot that resets on deploy; it is not an adoption counter.