DeepSeek OCR
Last updated November 24, 2026
Recognition modes, supported file formats, timeout rules, and request examples for DeepSeek OCR (deepseek/deepseek-ocr).
DeepSeek OCR (official /v1/tools/ocr endpoint) performs high-accuracy text and layout recognition across multi-page PDFs, Office documents, and images up to 100 MiB and 1,000 pages, outputting either plain text or Markdown with headings, tables, and mathematical formulas intact.
Invoke it through the Document OCR (POST /v1/tools/ocr) endpoint with Authorization: Bearer <key>.
Tool specifications
| Property | Details |
|---|---|
| Model ID | deepseek/deepseek-ocr |
| Aliases | deepseek-ocr |
Recognition modes (purpose) | text_recognition (extracts text directly from Word/PowerPoint without images, other formats page-by-page), rich_layout_recognition (recognizes every file page-by-page preserving headings, tables, formulas, and layout structure) |
| Supported formats | PDF, DOC, DOCX, PPT, PPTX, PNG, JPEG, WebP, GIF, BMP, TIFF |
| File and page limits | Max 100 MiB file size, up to 1,000 pages |
| Timeout rules | Upload ≤ 120 s, idle pause ≤ 30 s, total timeout ≤ 180 s |
| Billing | Billed strictly per recognized page (page_count); 0 pages or failed requests are free; usage tokens are informational only; see the model detail page for live pricing |
| Streaming | Not supported |
https://gateway.amux.ai/v1/tools/ocrAuthorization
headerAuthorizationstringRequiredBearer <your Amux AI key> Amux AI API key created in the console.
Request
multipart/form-datamodelstringRequiredModel identifier; supports canonical ID deepseek/deepseek-ocr or bare alias deepseek-ocr.
purpose"text_recognition" | "rich_layout_recognition"RequiredRecognition mode: text_recognition extracts text directly from Word/PowerPoint without images and processes other formats page-by-page; rich_layout_recognition recognizes every file page-by-page while preserving headings, tables, formulas, and layout structure.
filestringRequiredDocument or image file to recognize. Supports PDF, DOC, DOCX, PPT, PPTX, PNG, JPEG, WebP, GIF, BMP, and TIFF; max 100 MiB and up to 1,000 pages.
Response
200responseDocument OCR succeeded.
400responseMissing required fields, invalid purpose, or file exceeds the 100 MiB limit.
402responseInsufficient workspace balance.
Usage notes
- Choosing a mode: Use
text_recognitionfor plain scans and continuous text; userich_layout_recognitionfor multi-column layouts, financial tables, or documents containing LaTeX math. - Transparent keep-alive handling: For large PDFs, the service may emit leading newline keep-alives before the JSON body. The gateway trims leading whitespace and validates the payload so callers always receive clean JSON.
- Comparison with Jina OCR v1:
deepseek/deepseek-ocrusesPOST /v1/tools/ocrwith multipart file upload and per-page billing, ideal for multi-page PDF/Office files. If you want OpenAI vision-chat OCR viaimage_urlbilled per token, see Jina OCR v1.
Error handling
Errors follow the standard OpenAI error schema. Missing file or purpose, invalid purpose, files exceeding 100 MiB, or unsupported file types return 400 invalid_request. See Errors and retries.
curl https://gateway.amux.ai/v1/tools/ocr \
-H "Authorization: Bearer $AMUX_API_KEY" \
-F "model=deepseek/deepseek-ocr" \
-F "purpose=text_recognition" \
-F "file=@/path/to/file.png"{
"id": "ocr-0196a1b2c3d4",
"object": "ocr.result",
"created": 1763900000,
"model": "deepseek/deepseek-ocr",
"purpose": "text_recognition",
"page_count": 2,
"pages": [
{
"index": 0,
"text": "# Quarterly Financial Summary",
"finish_reason": "stop"
}
],
"usage": {
"input_tokens": 512,
"output_tokens": 128,
"total_tokens": 640
}
}