API key

Build

Document OCR

Send a scan or photo of a document to paranine/DeepSeek-OCR2 and get its text back as Markdown, with tables and line items kept.

In one line

Send a scan or photo of a document and get its text back as clean Markdown, with headings, tables and line items preserved, ready to search, store or pass to another model.

The route is paranine/DeepSeek-OCR2, on the same /v1/chat/completions endpoint and the same key as every other route.

Example: digitise a supplier invoice

Input: a scanned or photographed invoice (PNG, JPEG or WebP).

Output (an example of the shape, not a real capture):

# INVOICE

**Invoice No:** INV-2026-0412  **Date:** 7 October 2026
**Bill to:** Example Traders (Pvt) Ltd, Lahore

| Item                     | Qty | Unit price (Rs) | Amount (Rs) |
|--------------------------|----:|----------------:|------------:|
| Office chairs            |  12 |           8,500 |     102,000 |
| Standing desks           |   4 |          42,000 |     168,000 |
| **Subtotal**             |     |                 | **270,000** |
| Sales tax (18%)          |     |                 |      48,600 |
| **Total**                |     |                 | **318,600** |

What it costs: a request holds at most 8,192 tokens, so a page costs at most about 7 paisa (Rs 74 per 1,000 pages) at the prices below, and usually less.

Pricing

Price
InputRs 9.02 per 1M tokens
OutputRs 9.02 per 1M tokens

You pay for the tokens the model actually processes: the page image counts as input, the extracted text as output. Each response reports both in usage.

Code

Put your API key in P9_API_KEY. Each example reads invoice.png from the current folder and prints the Markdown.

export P9_API_KEY="sk_p9_…"   # your API key

curl -sS https://sovereign.paranine.com/v1/chat/completions \
  -H "Authorization: Bearer $P9_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<EOF
{
  "model": "paranine/DeepSeek-OCR2",
  "temperature": 0,
  "max_tokens": 4096,
  "messages": [{
    "role": "user",
    "content": [
      {"type": "image_url", "image_url": {"url": "data:image/png;base64,$(base64 < invoice.png | tr -d '\n')"}},
      {"type": "text", "text": "Convert the document to markdown."}
    ]
  }]
}
EOF

Good to know

  • One page per request. A request holds up to 8,192 tokens, input and output together. Keep max_tokens at 6,000 or below for one page.
  • Formats: PNG, JPEG or WebP. For a JPEG, use data:image/jpeg;base64, in the image URL.
  • Size: up to about 1.4 MB per image (requests are limited to 2 MB, and base64 adds a third).
  • Not in the playground. The dashboard playground sends text only; call this route from code.

Something unclear or wrong on this page? Tell us. Machine-readable copies: llms.txt.