OCRRouter

Jina OCR API docs

How OCRRouter calls Jina OCR, what the upstream returns field by field, and how that becomes Markdown and JSON blocks.

Overview

Jina OCR (jina-ocr-v1) is a page-to-Markdown model from Jina AI built on the DeepSeek-OCR architecture, a 3B MoE with about 570M active parameters.

OCRRouter calls it through AIHubMix and returns its Markdown per page. It gives no positions or scores.

Price and limits

Model ID
jina/jina-ocr
Price
1 credit / page ($1 per 1,000 pages)
Max pages per request
200
Inputs
PDF (rendered to page images); PNG, JPEG and other images AIHubMix accepts as image_url
Languages
About 100 languages
Positions (bbox)
No, text only
  • Up to 200 pages per job in OCRRouter
  • Text only: no layout blocks, bbox or confidence
  • Weights are CC BY-NC 4.0; hosted use is through AIHubMix

You pay only for pages that succeed. A failed attempt that falls back to another model is not charged. See pricing.

How OCRRouter calls it

Gateway
AIHubMix, OpenAI-compatible
Endpoint
POST https://aihubmix.com/v1/chat/completions
Upstream model
"jina-ocr-v1"
Request
One user message per page: the page as a base64 data URL in an image_url part, then the prompt as a text part
PDFs
Rendered to PNG at 150 dpi with poppler pdftoppm, one request per page, 4 pages at a time
Images
Sent as is, one request

Options

What OCRRouter sets on the upstream call. You choose the model, format and pages in your request; vendor-specific options are not passed through.

model
"jina-ocr-v1"
prompt
"Convert this document to Markdown."
temperature
0
PDF render
150 dpi PNG
Concurrency
4 pages at a time
Other parameters
None sent (no max_tokens, no stream, no response_format)
Client options
None. Callers cannot pass model options; OCRRouter fixes the request above.

Raw response fields

Every field the upstream documents, with its type and meaning taken from the vendor's own reference. Fields marked "read by OCRRouter" are the ones our connector uses; the rest are listed so you know what the engine produces.

What OCRRouter receives (AIHubMix chat completion)

AIHubMix exposes jina-ocr-v1 through its OpenAI-compatible POST /v1/chat/completions endpoint. OCRRouter sends one request per page image and gets back a standard chat completion object. Field meanings from OpenAI's chat completion object reference and our test call on 2026-11-19; the field list below is every field in that response.

Source: OpenAI chat completion object, retrieved 2026-11-19

idstring
Unique identifier for the chat completion.Example: "1795106679354"
objectstring
Object type, always "chat.completion".Example: "chat.completion"
createdinteger
Unix timestamp in seconds when the completion was created.Example: 1795106679
modelstring
Model that produced the completion.Example: "jina-ocr-v1"
choices[]array, read by OCRRouter
List of completion choices. OCRRouter sends no n parameter, so there is one.
choices[].indexinteger
Position of the choice in the list.Example: 0
choices[].message.rolestring
Role of the message author, "assistant".Example: "assistant"
choices[].message.contentstring or null, read by OCRRouter
Text the model generated. For these OCR models this is the page transcription.Example: "# Quarterly Report\n\nSales grew 12 percent in the third quart..."
choices[].message.refusalstring or null
Refusal message if the model refused; null otherwise.Example: null
choices[].finish_reasonstring
Why generation stopped: "stop" for a natural end, "length" when the token limit was hit.Example: "stop"
choices[].logprobsobject or null
Log probabilities, only when requested. OCRRouter does not request them.Example: null
choices[].message.typestring
Extra field AIHubMix adds for this model, "text" in our test call on 2026-11-19. Not in the OpenAI reference, AIHubMix docs or the Jina repo.Example: "text"
system_fingerprintstring
Backend configuration fingerprint, per OpenAI's reference.Example: "fp_1795106679354"
usage.prompt_tokensinteger
Tokens in the prompt, including the image.Example: 5259
usage.completion_tokensinteger
Tokens in the generated output.Example: 216
usage.total_tokensinteger
Prompt plus completion tokens. AIHubMix bills per token.Example: 5475

Real response captured 2026-11-19 by OCRRouter with the exact request shown under Options, on an 800x420 PNG with a heading, a paragraph and a 3x3 table. Nothing edited.

{"id": "1795106679354","model": "jina-ocr-v1","object": "chat.completion","created": 1795106679,"choices": [{"index": 0,"finish_reason": "stop","logprobs": null,"message": {"role": "assistant","content": "# Quarterly Report\n\nSales grew 12 percent in th…","type": "text","refusal": null}}],"system_fingerprint": "fp_1795106679354","usage": {"prompt_tokens": 5259,"completion_tokens": 216,"total_tokens": 5475}}

Jina OCR native output

The model returns one decoded string with no markers or boxes. Field meanings from the jina-ocr-v1 model card (README.md), processing_deepseek_ocr.py and our test call on 2026-11-19. decode_ocr() in processing_deepseek_ocr.py decodes the tokens after the prompt and strips EOS, pad, BOS and image tokens, so the string is only the transcription. The default prompt (DEFAULT_OCR_PROMPT) asks for clean Markdown in reading order; the card's benchmark prompt asks for LaTeX math, HTML tables and the string null for empty pages. OCRRouter sends "Convert this document to Markdown.", and our test got Markdown headings and a pipe table, not HTML. Although the model builds on DeepSeek-OCR, the card documents no grounding prompt, so OCRRouter gets no boxes.

Source: jina-ocr-v1 processing_deepseek_ocr.py, retrieved 2026-11-19

message.contentstring, read by OCRRouter
Page transcription as Markdown: # headings, paragraphs separated by blank lines, tables as GitHub pipe tables with our prompt (HTML tables under the card's benchmark prompt), or the literal null for a page with no text under that prompt.Example: "# Quarterly Report\n\nSales grew 12 percent..."

The message.content string from the real response above, captured 2026-11-19.

# Quarterly Report

Sales grew 12 percent in the third quarter.

| Region | Q2 | Q3 |
|---|---|---|
| North | 120 | 134 |
| South | 98 | 110 |

How it maps to OCRRouter output

choices[0].message.content
Page text. A wrapping ```markdown fence is stripped.
HTML <table> in content
Rewritten as a GitHub-flavoured Markdown table (htmlTablesToMarkdown); the first row is the header
One response per page
pages[i] in OCRRouter output, in page order
Layout, bbox, confidence
Not returned. This model gives text only, so OCRRouter output has no layout blocks
Content "null"
Kept as text; the model card says it outputs null for pages with no text

The unified output is described in Response format.

Example request

curl https://api.ocrrouter.ai/v1/ocr \
  -H "Authorization: Bearer $OCRROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jina/jina-ocr",
    "file_url": "https://example.com/invoice.pdf",
    "format": "json"
  }'

Sources

Vendor documentation read on 2026-11-19.