Models/ DeepSeek

DeepSeek-OCR 2, served as an API

DeepSeek-OCR 2 reads pages the way an LLM reads text: send a page image, describe the output you want (markdown, JSON fields, plain text), and get structured results in one step. No self-hosting, no GPU rental, no per-page pricing.

  • Purpose-built OCR model
  • Markdown or JSON out
  • Cheapest tokens in the catalog
  • Batch at 50% off

Per token, nothing else.

Input / output per 1M tokens

$0.039 / $0.039

Batch jobs: $0.019 / $0.019 (50% off, 24h window)

openrelay/deepseek-ocr-2

Full catalog on the inference pricing page. Deposit $5 to get $10.

ocr.py · one page, structured outpython
from openai import OpenAI

client = OpenAI(
    base_url="https://inference.openrelay.inc/v1",
    api_key="vl_••••••••",          # same SDK, new base URL
)

import base64
page = base64.b64encode(open("invoice.png", "rb").read()).decode()

resp = client.chat.completions.create(
    model="openrelay/deepseek-ocr-2",
    messages=[{"role": "user", "content": [
        {"type": "text", "text":
            "Extract this invoice as JSON: {vendor, date, total}."},
        {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{page}"}},
    ]}],
)
print(resp.choices[0].message.content)

The spec sheet.

What the model is, what it takes in, and the surface it serves on.

Model id
openrelay/deepseek-ocr-2
Modality
Vision in (page images), text out
Context
8K tokens per request; one page per request is the pattern
Endpoint
POST /v1/chat/completions with image message parts
Output
Prompt-defined: markdown, JSON fields, or plain transcription
Best at
Printed documents, tables, invoices, receipts, mixed layouts

Where DeepSeek-OCR 2 earns its place.

What this model is actually for, versus the rest of the catalog.

OCR and parsing in one call

Because the OCR engine is an LLM, 'extract vendor, date, line_items, total as JSON' is a single request. Classic OCR-then-parse pipelines collapse into one step with one failure mode.

Priced like text, not like pages

Commercial OCR APIs charge $1 to $15 per thousand pages. At $0.039 per 1M tokens realtime (half that in batch), a typical page costs a few hundredths of a cent, which changes what is worth digitizing at all.

Layout survives transcription

Tables stay tables, headings stay headings, multi-column text comes out in reading order. Ask for markdown and the document structure arrives with the text.

Run it in batch at half price.

Archives are the real OCR workload. The Batch API takes one JSONL line per page and returns transcriptions within 24h at half the realtime rate; a thousand pages generally lands around a dime.

Batch Inference API overview

DeepSeek-OCR 2, answered.

Is there a hosted DeepSeek-OCR API?

Yes, this one. DeepSeek-OCR 2 is live as openrelay/deepseek-ocr-2 behind the OpenAI-compatible chat completions endpoint: send the page as an image part and the instruction as text. No self-hosting, no vLLM setup, no GPU to rent.

What does DeepSeek-OCR 2 cost?

$0.039 per 1M tokens each way realtime, about $0.02 in batch. A typical page is a few thousand image tokens in and under a thousand out, so a thousand pages costs roughly a dime in batch. Compare per-page OCR APIs at $1 to $15 per thousand.

How accurate is it versus Tesseract or cloud OCR?

On clean print all modern engines are near-perfect. DeepSeek-OCR 2 pulls ahead on layout (tables, columns), ambiguous characters resolved by context, and messy scans, and it can restructure while reading. For compliance work, spot-check a sample per corpus; that audit is itself a cheap batch job.

Can it extract fields from invoices and receipts directly?

Yes. Name the fields in the prompt and it returns JSON in the same call: no template matching, no post-processing pass. The document-ocr workload page has the full JSONL patterns for invoices, receipts, and mixed archives.

How do I OCR a whole archive?

Split PDFs to page images, one JSONL record per page with the document key in custom_id, and submit through the Batch API. Up to 50,000 pages per job, results within 24h, failures isolated per page in a separate error file.

First request in five lines.

Point the OpenAI SDK at inference.openrelay.inc/v1 and run DeepSeek-OCR 2 per token. No contract, no minimums.