# X402 PDF Document Extraction

> X402 PDF Document Extraction is a paid API for AI agents from x402.feld-feder.at, paid per call via x402, $0.015/call, status down (last checked 2026-09-15).

Fetches a PDF from a URL and extracts its text content, returning plain text or structured output using pypdf or OCR-based layout analysis.

## Facts

- Endpoint: POST https://x402.feld-feder.at/v1/document/pdf
- Price: $0.015/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-pdf-document-extraction-5142ae46
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iVbj93KnAztdcaUiNOV_O

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 x402-pdf-document-extraction-5142ae46 -d '<json body>'
```

Example prompt: Can you grab the PDF at https://example.com/report.pdf and extract all the text from it? Use structured mode so the layout is properly handled.

## When to prefer this

Choose this endpoint when you need to extract text from a PDF document available at a public URL, especially when you want automatic fallback between fast pypdf extraction and full OCR/layout analysis. It is pay-per-request ($0.015 USDC) via x402, making it suitable for agents that process PDFs on demand without subscription overhead. Prefer it over generic scraping tools when the source is specifically a PDF file rather than an HTML page.

## Known failure modes

- URL unreachable or returns non-PDF content — likely returns an error envelope with no text
- PDF is password-protected or encrypted — extraction may fail or return empty text
- Very large PDFs may time out or incur higher latency
- Scanned PDFs in auto mode may return empty text if pypdf is selected instead of docling
- Malformed URL input (too long, empty) — schema validation error
- Payment failure via x402 protocol — request blocked before processing

## How this service works

Pay-per-request data tools for AI agents.

## Output

A JSON object with an 'ok' flag and a 'data' object containing: the extracted 'text' (plain string or null), 'markdown' (formatted or null), 'format' (always 'pdf'), 'processor' (either 'pypdf' for machine-readable PDFs or 'docling' for OCR/layout), 'page_count' (integer), and 'processing_time_ms'. May also include cache hit info and source URL metadata.

## 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": {
     "type": "object",
     "title": "DocumentPdfRequest",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "title": "Url",
       "maxLength": 4096,
       "minLength": 1
      },
      "mode": {
       "enum": [
        "auto",
        "text",
        "structured"
       ],
       "type": "string",
       "title": "Mode",
       "default": "auto",
       "description": "Auto uses pypdf for useful machine text; structured forces the private layout/OCR worker."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "title": "ResponseEnvelope[DocumentPdfResult]",
     "required": [
      "data"
     ],
     "properties": {
      "ok": {
       "type": "boolean",
       "const": true,
       "title": "Ok",
       "default": true
      },
      "data": {
       "type": "object",
       "title": "DocumentPdfResult",
       "required": [
        "processor",
        "page_count",
        "processing_time_ms"
       ],
       "properties": {
        "text": {
         "anyOf": [
          {
           "type": "string"
          },
          {
           "type": "null"
          }
         ],
         "title": "Text",
         "default": null
        },
        "format": {
         "type": "string",
         "const": "pdf",
         "title": "Format",
         "default": "pdf"
        },
        "markdown": {
         "anyOf": [
          {
           "type": "string"
          },
          {
           "type": "null"
          }
         ],
         "title": "Markdown",
         "default": null
        },
        "processor": {
         "enum": [
          "pypdf",
          "docling"
         ],
         "type": "string",
         "title
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "text": "Example",
   "format": "pdf",
   "markdown": null,
   "processor": "pypdf",
   "page_count": 1,
   "processing_time_ms": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-pdf-document-extraction-5142ae46/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.feld-feder.at](https://www.zero.xyz/host/x402.feld-feder.at/llms.txt)
