Skip to content
SchemaSure

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.

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.

APIUse whenEndpointPriceBrief
SchemaSure
Text extraction
you hold unstructured text or HTML and need JSON that matches a schema you supplyPOST /v2/extract$0.02/call, flat, failed calls freellms.txt
SchemaSure
Image extraction
you hold a document image — scan, receipt, form, label, or screenshot — and need JSON that matches a schema you supplyPOST /v2/extract-image$0.06/image, flat, failed calls freellms.txt
ChronoSure
Business time
you must resolve a local time, a DST ambiguity, a business-day offset, or a public holiday for a timezonePOST /v1/business-time
chrono.schemasure.com
$0.02/call listllms.txt
SQLPermit
SQL guard
you are about to execute a PostgreSQL statement and need it checked against a policy firstPOST /v1/guard/sql
sqlpermit.schemasure.com
$0.02/call listllms.txt
TxGuard
Transaction preflight
you are about to sign a Base transaction or an x402 payment authorization and need to know what it actually doesPOST /v1/tx/preflight
txguard.schemasure.com
$0.02/call listllms.txt
SafeFetch
Safe fetch
you must read an untrusted web page and want the prose without the instructions hidden inside itPOST /v1/fetch
safefetch.schemasure.com
$0.02/call listllms.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 holdsPOST /v1/chain/state
chainstate.schemasure.com
$0.02/call listllms.txt
PayeeGuard
Payee guard
you are about to send funds and want the destination checked before the transfer becomes irreversiblePOST /v1/guard/payee
payee.schemasure.com
$0.02/call listllms.txt
AllowanceGuard
Allowance guard
you are about to approve a token spender and need to know what that grant actually permitsPOST /v1/guard/allowance
allowance.schemasure.com
$0.03/call listllms.txt
ReceiptSure
Receipt verification
a Base transaction has landed and you need to know whether it did what you intended, not merely that it succeededPOST /v1/tx/receipt-verify
receipt.schemasure.com
$0.02/call listllms.txt
ShellPermit
Shell guard
you are about to run a shell command and need it checked against a policy before it executesPOST /v1/guard/shell
shellpermit.schemasure.com
$0.03/call listllms.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.

InputUseEndpointPrice
Text or HTMLEmails, pages, logs, OCR text, resumes, invoices/v2/extract$0.02/call, flat, failed calls free
Document imageScans, 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

  1. The unsigned request returns 402 with PAYMENT-REQUIRED.
  2. Validate the live price, network, asset, payee, and resource; sign them with an x402 V2 wallet/client.
  3. Retry the identical request with PAYMENT-SIGNATURE.
  4. On 200, read PAYMENT-RESPONSE for 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 evaluationV2 production
Endpoint/extract/v2/extract
Free calls3 limited calls/clientNo—payment from first call
Recommended forTrying SchemaSureProduction agents and marketplaces
Protocolx402 V1x402 V2

Extraction pricing

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

HTTPCodesAgent action
400 / 413BAD_REQUEST, INVALID_SCHEMA, INPUT_TOO_LARGE, UNSUPPORTED_INPUT_TYPEFix or reduce the request. Do not retry it unchanged.
402PAYMENT_REQUIRED, PAYMENT_INVALIDValidate and sign the live challenge, or obtain a fresh challenge. Retry the identical body only.
422EXTRACTION_FAILED, VALIDATION_FAILED, ABSTAINEDChange the input/schema or use a fallback. No settlement occurs.
429RATE_LIMITEDWait for Retry-After.
500 / 502 / 504INTERNAL, UPSTREAM_LLM_ERROR, PAYMENT_UPSTREAM, TIMEOUTRetry 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.