Skip to content
SchemaSure

Schema-valid JSON from text or document images.

Extraction is two of six pay-per-call APIs for autonomous agents. Pay per successful call with x402 V2 on Base mainnet—no account or API key.

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.

Six APIs, one payment rail

Every service below is pay-per-call over x402 V2 with USDC on Base mainnet, with no account and no API key, and settles only on a successful result. This origin serves the two extraction APIs; the other four run on their own subdomains and publish their own schemas, benchmarks, and payment manifests.

APIUse whenEndpointPriceBrief
SchemaSure
Text extraction
you hold unstructured text or HTML and need JSON that matches a schema you supplyPOST /v2/extract$0.01/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.03/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.01/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.01/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.01/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.01/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 all six, read /apis.json or /SKILL.md.

Choose the right extraction API

InputUseEndpointPrice
Text or HTMLEmails, pages, logs, OCR text, resumes, invoices/v2/extract$0.01/call, flat, failed calls free
Document imageScans, receipts, forms, labels, screenshots, photos/v2/extract-image$0.03/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

Pricing

Why agents can trust it

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.

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.

Agent integration

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.