# SchemaLock Custom Schema Document Extraction

> SchemaLock Custom Schema Document Extraction is a paid API for AI agents from doc-extract-api.thestarboy9696-4ef.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Extracts structured JSON from any PDF or image file according to a user-supplied JSON Schema, supporting arbitrary field definitions beyond fixed document types.

## Facts

- Endpoint: GET https://doc-extract-api.thestarboy9696-4ef.workers.dev/extract/custom
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/schemalock-custom-schema-document-extraction-70e23ded
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_didE7-RV3DU4lHu8tpAjZ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability schemalock-custom-schema-document-extraction-70e23ded
```

Example prompt: I have a scanned lab report PDF — can you extract the patient name, test names, result values, and reference ranges into structured JSON using this schema I've defined: {"type":"object","properties":{"patient_name":{"type":"string"},"tests":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"result":{"type":"string"},"reference_range":{"type":"string"}}}}}}?

## When to prefer this

Choose this endpoint when you need to extract structured data from a PDF or image into a custom, arbitrary schema that doesn't fit the predefined invoice, receipt, resume, or contract templates. Ideal when your document type is niche (lab reports, permits, forms, certificates, custom business documents) or when you need a non-standard set of fields. Use the fixed-template endpoints instead if your document is a standard invoice, receipt, contract, or resume, as those are optimized for their respective formats. This endpoint gives maximum flexibility at the same price point.

## Known failure modes

- 400 error if the supplied JSON Schema exceeds 6000 characters — no charge incurred
- 400 error if the schema is malformed or invalid JSON Schema
- Extraction inaccuracy if the source document is low quality, poorly scanned, or handwritten
- Missing or null field values if the requested fields are not present in the document
- Timeout or processing error for very large or complex PDF files
- Payment failure if the x402 USDC payment of $0.08 cannot be processed

## How this service works

SchemaLock — extract structured JSON data from any PDF/image or raw text/HTML, converting it into a JSON Schema you supply, not limited to invoice/receipt/contract/resume. Unlike the fixed invoice/receipt/contract/resume endpoints, this accepts any JSON Schema — you define the fields. Takes a PDF/image file OR raw text/HTML you already have (e.g. a scraped page). Schema-conformance, not fact-checking. A rejected schema is a 400 and costs nothing.

## Output

Returns a JSON object whose keys and value types are determined by the caller-supplied JSON Schema. Each field in the schema is populated with the corresponding data extracted from the provided PDF or image. The extraction uses forced tool-use against the schema, so the output is guaranteed to be schema-conformant in structure, though semantic accuracy depends on document readability. No fact-checking or semantic validation is performed beyond schema conformance.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/schemalock-custom-schema-document-extraction-70e23ded/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from doc-extract-api.thestarboy9696-4ef.workers.dev](https://www.zero.xyz/host/doc-extract-api.thestarboy9696-4ef.workers.dev/llms.txt)
