# StructDoc Document Structuring API

> StructDoc Document Structuring API is a paid API for AI agents from structdoc-api.hp-vladic.workers.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Converts PDF or image documents into structured data (Markdown, tables, key-value pairs, invoice/receipt fields) using OCR and layout analysis across 100+ languages

## Facts

- Endpoint: POST https://structdoc-api.hp-vladic.workers.dev/read
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/structdoc-document-structuring-api-7dec385a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pZICsZqt285juTQBFYAYp

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 structdoc-document-structuring-api-7dec385a -d '<json body>'
```

Example prompt: I have a scanned invoice PDF — can you extract all the line items, totals, and vendor info from it and give me the result as structured Markdown?

## When to prefer this

Choose this endpoint when you need to convert unstructured PDF or image documents into machine-readable structured data — especially invoices, receipts, forms, or scanned pages — and want a pay-per-call model with no API key setup. Prefer it over general LLM vision when you need reliable layout-aware Markdown, table extraction, or structured field parsing across 100+ languages at $0.05/call.

## Known failure modes

- Unsupported file type returns an error — only PDF and common image formats accepted
- Document too large or complex may exceed processing limits
- Low-quality scans may reduce OCR accuracy
- Non-Latin scripts in unsupported language variants may produce degraded output
- Payment failure via x402/USDC will block the request before processing
- Missing or malformed document input returns a 400-level error

## How this service works

Turn any document into structured data for AI agents — OCR, layout-to-Markdown, tables, key-value, invoice/receipt fields — from PDF/images in 100+ languages. Pay per call via x402 (USDC). No API keys.

## Output

A JSON object containing the model name used (e.g. 'prebuilt-layout'), the number of pages processed, the output format (e.g. 'markdown'), and a 'content' field with the full structured extraction — Markdown text, tables, key-value pairs, or invoice/receipt fields depending on the document type.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Document URL (PDF/image)"
  },
  "pages": {
   "type": "string",
   "description": "Page range e.g. \"1-5\""
  },
  "base64": {
   "type": "string",
   "description": "Base64 document bytes (≤~6MB)"
  },
  "features": {
   "type": "string",
   "description": "languages,barcodes,keyValuePairs"
  },
  "queryFields": {
   "type": "string",
   "description": "custom fields, comma-separated ≤8"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "prebuilt-layout",
  "pages": 1,
  "format": "markdown",
  "content": "# ..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/structdoc-document-structuring-api-7dec385a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from structdoc-api.hp-vladic.workers.dev](https://www.zero.xyz/host/structdoc-api.hp-vladic.workers.dev/llms.txt)
