All models

DeepSeek

DeepSeek-OCR-2

About

DeepSeek-OCR-2 is a 3.4B open-weight model from DeepSeek. DeepSeek OCR 2 and markdown extraction. It accepts text, images, and documents. Context window is 32K. Released January 27, 2026.

  • Parameters

    3.4B

    Published parameter count.

  • Context window

    32K

    Tokens of context on a request.

  • License

    MIT

    License on the weights.

Pricing

Token rates are US dollars per 1M tokens. Image rates are per 1K images. Audio rates are per 1M audio seconds.

RatePrice
Input / 1M$0.25
Cached input / 1M$0.25
Output / 1M$0.80

Compare

DeepSeek-OCR-2 is one of the catalog's OCR models. The table is each model's published price, size, and context.

ModelWhat it doesPriceParametersContext
DeepSeek-OCR-2DeepSeek OCR 2 and markdown extraction.$0.25 / 1M input3.4B32K
PP-OCRv6PaddleOCR PP-OCRv6 medium text detection and recognition; scene OCR JSONL on image chat; text returns plain text; document_url fan-out via text.$0.02 / 1M input20M—
dots.mocrMultilingual document layout parsing and markdown OCR.$0.20 / 1M input3B32K
GLM-OCRCompact multilingual document OCR and markdown extraction.$0.10 / 1M input0.9B8K

Benchmarks

Published scores for DeepSeek-OCR-2, from the OmniDocBench leaderboard.

Evals
ReadingExample
QualitativeClear structure, grounded in the input
QuantitativeOmniDocBench v1.6: 90.25.
Cost and performanceLower listed rate, mid-pack latency

Performance

Latency is the end-to-end round trip. Throughput is completion tokens divided by that time. It is a request rate, not decode speed.

  • Latency

    719 ms

  • Throughput

    —

  • Requests

    151

Supported inputs

  • textIgnored

    A text part beside the media is accepted and ignored. A request with no media part is a 400.

  • image_urlYes

    One per request. A second image_url part is a 400.

  • video_urlNo

    Not accepted.

  • document_urlYes

    One PDF, up to 128 pages, rasterized per page at document_dpi (default 96). See Document Inputs.

  • Default method markdown. Three methods return the page as a string; grounding_ocr locates a phrase and returns region boxes instead.
  • Context window 32,768 tokens, with a maximum output of 8,192 tokens.
  • Weights: deepseek-ai/DeepSeek-OCR-2. Aliases are listed below.

Methods

Methods this model serves. Payload shapes are in the docs.

MethodReturns
markdownReading-order Markdown string (default)
ocrMarkdown via the grounded conversion prompt; grounding tags are stripped from the output
free_ocrFree-form plain read of the page
grounding_ocrRegion items with bbox_xywh and the matched text

Text mode emits the string alone for one image, and one <document> / <page> block per PDF page. In JSON mode an image content is the string, or the region container for grounding_ocr, and a document page content is always doc.page.blocks. See Methods & Response Format.

The model grounds on a fixed 0-1000 grid; the Gateway normalizes every box to 0-1 against the image or rasterized page, at precision decimals (default 4). Grounding regions carry bbox_xywh and text only: no polygon and no score.

Method parameters

ParameterDefaultDescription
promptnonegrounding_ocr only: the full grounding prompt, with the phrase to locate wrapped in the model's ref markers. See Grounding.

Grounding

grounding_ocr answers "where does this appear on the page". Pass the full grounding prompt via method_params.prompt, with the phrase to locate wrapped in the model's ref markers:

response = client.chat.completions.create(
    model="deepseek-ai/deepseek-ocr-2",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.receipt/playground/2.jpg"
                    },
                },
            ],
        }
    ],
    extra_body={
        "method": "grounding_ocr",
        "method_params": {"prompt": "<image>\nLocate <|ref|>Total Amount<|/ref|> in the image."},
    },
)

The reply is the region container, alone in text mode and under content in JSON mode:

{"object": "doc.ocr.lines", "items": [{"bbox_xywh": [0.102, 0.08, 0.893, 0.06], "text": "Annual Report 2024"}, {"bbox_xywh": [0.102, 0.16, 0.893, 0.08], "text": "Overview"}]}

On a PDF each page's content is doc.page.blocks, with one block per located region carrying the same bbox_xywh and text.

Aliases

deepseek-ai/deepseek-ocr-2 (preferred), deepseek-ocr-2, and deepseek-ai/DeepSeek-OCR-2 all resolve to this model.

Estimate cost

Estimate. A page is 1,200 input tokens and 1,000 output tokens.

$1.10

Quick start

Call this model on the OpenAI-compatible gateway. The model id is already filled in.

from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.vlm.run/v1/openai",
    api_key="<VLMRUN_API_KEY>",
)

response = client.chat.completions.create(
    model="deepseek-ai/deepseek-ocr-2",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "document_url",
                    "document_url": {
                        "url": "https://storage.googleapis.com/vlm-data-public-prod/hub/examples/finance.sec-filings/tsla-8k.pdf"
                    },
                },
            ],
        }
    ],
    extra_body={"method": "markdown"},
)

print(response.choices[0].message.content)

Response

One <document> block per PDF, one <page> block per page, each carrying format="markdown":

tsla-8k.pdf2 pages

Page 0

Annual Report 2024

Overview

The company reported revenue of $1.2M.

Page 1

Metric20232024
Revenue0.9M1.2M

A single image returns the Markdown string alone, with no wrapper.

Get an API key. Ship vision today.