---
title: "OCR Document Parsing"
method: POST
path: "/v1/ocr-document-parsing"
tags: ["documents"]
---

# OCR Document Parsing

`POST /v1/ocr-document-parsing`

## Request

- Base URL: `https://agent.pocket.network`
- URL: `https://agent.pocket.network/v1/ocr-document-parsing`
- Auth: none required

OCR and document parsing: turn an image or PDF into extracted text with layout hints. POST /v1/ocr with a document (or raw text) in the body and get the extracted text and metrics as one JSON object. Deterministic on clean inputs at a fixed engine version. Pay per request in USDC; no account, no API key.

## Request body

- object: Provide a document to OCR or raw text; input lives in the body since callers cannot send headers.
  - `image` string: Base64-encoded image.
  - `pdf` string: Base64-encoded PDF.
  - `text` string: Raw text (bypasses OCR).

## Response `200`

The upstream response, served after payment settles.

- object: For POST /v1/ocr, a JSON object with the extracted text, character count (`chars`), and layout hints. The exact shape is the service's own and is not pinned here; errors return a JSON object with an `error` field, and the GET routes return their own small JSON documents.

## Other responses

- `400`: Malformed request.
- `402`: Payment required. The x402 v2 terms are in the PAYMENT-REQUIRED header and, identically, in this body; sign the chosen option and retry with the PAYMENT-SIGNATURE header. The receipt arrives in PAYMENT-RESPONSE.
- `503`: This service is not currently available to serve.

---

[API](https://skmtc.dev/pocket/apis/pocket-agentic-portal.md) · [All operations](https://skmtc.dev/pocket/apis/pocket-agentic-portal/llms.txt) · [OpenAPI document](https://skmtc.dev/pocket/apis/pocket-agentic-portal/revisions/96d2176db014?raw)
