image_url or a document_url PDF;
no text-only input. Default method: markdown. Three methods return the page as
a string; grounding_ocr instead locates a phrase and returns region boxes.
Output by method
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
document.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.
Request
Response
- Text mode
- JSON mode
One A single image returns the Markdown string alone, with no wrapper.
<document> block per PDF, one <page> block per page, each carrying
format="markdown":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:
data in
JSON mode:
content is document.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.