---
title: "Ocr Url"
method: POST
path: "/v1/ocr/url"
---

# Ocr Url

`POST /v1/ocr/url`

## Request

- Base URL: `https://api.pennyocr.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pennyocr.com/v1/ocr/url`
- Auth: HTTP bearer

OCR a document by URL, with page ranges and agent-safe spend guards.

## Request body

- UrlOCRRequest
  - `url` string, required
  - `format` string
  - `pages` string, nullable: Page range like '1-20,25'. Default: all.
  - `max_pages` integer, nullable: Refuse (413) if selection exceeds this.
  - `max_cost_usd` number, nullable: Refuse (413) if cost would exceed this.

## Response `200`

Successful Response

- OCRResponse
  - `id` string, required: Request id, e.g. ocr_ab12cd34
  - `pages` integer, required
  - `text` string, required: Full extracted text, pages joined by form feeds
  - `page_results` PageResult[], required
    - `page` integer, required: 1-indexed page number
    - `text` string, required
  - `cost_usd` number, required
  - `model` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pennyocr/apis/pennyocr-api.md) · [All operations](https://skmtc.dev/pennyocr/apis/pennyocr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pennyocr/apis/pennyocr-api/revisions/0f7ed2e08b83?raw)
