Intelligent document extraction powered by AI — parse any document format into clean, structured output.
bash
npm install -g mineru-open-api
Or via Go (macOS/Linux):
bash
go install github.com/opendatalab/MinerU-Ecosystem/cli/mineru-open-api@latest
bash
mineru-open-api version
flash-extract``extractToken requiredNoYes ( mineru-open-api auth)SpeedFastNormalTable recognitionNoYesFormula recognitionNoYesOCRYesYesOutput formatsMarkdown onlymd, html, latex, docx, jsonBatch modeNoYesModel selectionpipelineYes (vlm, pipeline, MinerU-HTML)File size limit10 MBMuch higherPage limit20 pagesMuch higherRate limitPer-IP per-minute capBased on API planBest forQuick start, small/simple docsLarge docs, tables, production
LimitValueFile sizeMax 10 MBPage countMax 20 pagesSupported typesPDF, Images (png/jpg/jpeg/jp2/webp/gif/bmp), Docx, PPTxIP rate limitPer-minute request caps (HTTP 429 when exceeded)
When any limit is exceeded, the agent should suggest switching to extract with a token (create at https://mineru.net/apiManage/token), which has significantly higher limits.
mineru-open-api flash-extract <file> for quick Markdown conversionmineru-open-api auth, then use mineru-open-api extract for tables, formulas, OCR, multi-format, and batchmineru-open-api crawl <url> to convert web content-o directoryOnly required for extract and crawl. Not needed for flash-extract.
Configure your API token (create one at https://mineru.net/apiManage/token):
bash
mineru-open-api auth # Interactive token setup
export MINERU_TOKEN="your-token" # Or set via environment variable
Token resolution order: --token flag > MINERU_TOKEN env > ~/.mineru/config.yaml.
Formatflash-extract``extractPDF ( .pdf)YesYesImages ( .png, .jpg, .jpeg, .jp2, .webp, .gif, .bmp)YesYesWord ( .docx)YesYesWord ( .doc)NoYesPowerPoint ( .pptx)YesYesPowerPoint ( .ppt)NoYesHTML ( .html)NoYesURLs (remote files)YesYes
The crawl command accepts any HTTP/HTTPS URL and extracts web page content.
Fast, token-free document extraction. Outputs Markdown only. No table recognition. Limited to 10 MB / 20 pages per file, with IP-based rate limiting.
bash
mineru-open-api flash-extract report.pdf # Markdown to stdout
mineru-open-api flash-extract report.pdf -o ./out/ # Save to file
mineru-open-api flash-extract https://example.com/doc.pdf # URL mode
mineru-open-api flash-extract report.pdf --language en # Specify language
mineru-open-api flash-extract report.pdf --pages 1-10 # Page range
FlagShortDefaultDescription--output``-o_(stdout)Output path (file or directory)--language``chDocument language--pages(all)_Page range, e.g. 1-10``--timeout``900Timeout in seconds
Convert PDFs, images, and other documents to Markdown or other formats. Supports table/formula recognition, OCR, multiple output formats, and batch mode.
bash
mineru-open-api extract report.pdf # Markdown to stdout
mineru-open-api extract report.pdf -f html # HTML to stdout
mineru-open-api extract report.pdf -o ./out/ # Save to directory
mineru-open-api extract report.pdf -o ./out/ -f md,docx # Multiple formats
mineru-open-api extract *.pdf -o ./results/ # Batch extract
mineru-open-api extract --list files.txt -o ./results/ # Batch from file list
mineru-open-api extract https://example.com/doc.pdf # Extract from URL
cat doc.pdf | mineru-open-api extract --stdin -o ./out/ # From stdin
FlagShortDefaultDescription--output``-o_(stdout)Output path (file or directory)--format``-f``mdOutput formats: md, json, html, latex, docx (comma-separated)--model(auto)Model: vlm, pipeline, html (see below)--ocr``falseEnable OCR for scanned documents--formula``trueEnable/disable formula recognition--table``trueEnable/disable table recognition--language``chDocument language--pages(all)_Page range, e.g. 1-10,15``--timeout``900/ 1800Timeout in seconds (single/batch)--listRead input list from file (one path per line)--concurrency``0Batch concurrency (0 = server default)
vlm``pipelineParsing accuracyHigher — better at complex layouts, mixed contentStandardHallucination riskMay produce hallucinated text in rare casesNo hallucination — biggest advantageBest forAcademic papers, complex tables, intricate layoutsGeneral documents where fidelity matters most
When the user values accuracy and the document has complex formatting, suggest --model vlm. When the user prioritizes reliability and no-hallucination guarantee, suggest --model pipeline (or omit --model to use auto).
Fetch web pages and convert to Markdown.
bash
mineru-open-api crawl https://example.com/article # Markdown to stdout
mineru-open-api crawl https://example.com/article -f html # HTML to stdout
mineru-open-api crawl https://example.com/article -o ./out/ # Save to file
mineru-open-api crawl url1 url2 -o ./pages/ # Batch crawl
mineru-open-api crawl --list urls.txt -o ./pages/ # Batch from file list
FlagShortDefaultDescription--output``-o_(stdout)_Output path--format``-f``mdOutput formats: md, json, html (comma-separated)--timeout``900/ 1800Timeout in seconds (single/batch)--listRead URL list from file (one per line)--stdin-list``falseRead URL list from stdin--concurrency``0Batch concurrency
bash
mineru-open-api auth # Interactive token setup
mineru-open-api auth --verify # Verify current token is valid
mineru-open-api auth --show # Show current token source and masked value
--language values#The --language flag accepts the following values (default: ch). Used by both flash-extract and extract. Values are organized by script/language family — each value covers all languages listed in its group.
ValueIncluded languageschChinese, English, Chinese Traditionalch_serverChinese, English, Chinese Traditional, JapaneseenEnglishjapanChinese, English, Chinese Traditional, JapanesekoreanKorean, Englishchinese_chtChinese, English, Chinese Traditional, JapanesetaTamil, EnglishteTelugu, EnglishkaKannadaelGreek, EnglishthThai, English
ValueScript/FamilyIncluded languageslatinLatin scriptFrench, German, Italian, Spanish, Portuguese, Dutch, Swedish, and 40+ morearabicArabic scriptArabic, Persian, Uyghur, Urdu, Pashto, Kurdish, and morecyrillicCyrillic scriptRussian, Ukrainian, Bulgarian, Serbian, Kazakh, and 20+ moreeast_slavicEast SlavicRussian, Belarusian, Ukrainian, EnglishdevanagariDevanagari scriptHindi, Marathi, Nepali, Sanskrit, and more
-o flag: result goes to stdout; status/progress messages go to stderr-o flag: result saved to file/directory; progress messages on stderrextract/ crawl only): requires -o to specify output directorydocx, extract only): cannot output to stdout, must use -o.md fileWhen using this skill on behalf of the user:
mineru-open-api extract "report 01.pdf", NOT mineru-open-api extract report 01.pdf.mineru-open-api extract.mineru-open-api extract file.docx or mineru-open-api flash-extract file.docx. Note: .doc format is only supported by extract, not flash-extract.extract (not flash-extract). If the user mentions tables, use extract.-o), only one text format can be output at a time. If the user wants multiple formats, suggest adding -o.The agent MUST follow this decision logic:
Default to flash-extract when:
~/.mineru/config.yaml, no MINERU_TOKEN env)Use extract when:
If unsure, prefer flash-extract — it's faster and requires no setup, but check file size first.
When the user does NOT specify an output path ( -o), the agent MUST generate a default output directory to prevent file overwrites. Use:
text
~/MinerU-Skill/<name>_<hash>/
Naming rules:
<name>: derived from the source, then sanitized for safe directory names.
https://arxiv.org/pdf/2509.22186 → 2509.22186)report.pdf → report)_. Collapse consecutive _ into one. Keep alphanumeric, -, _, ., and CJK characters.<hash>: first 6 characters of the MD5 hash of the full original source path or URL (before sanitization).
bash
echo -n "https://arxiv.org/pdf/2509.22186" | md5sum | cut -c1-6
bash
npm install -g mineru-open-api@latest
When flash-extract fails due to file limits or rate limiting, the agent MUST provide a clear explanation and suggest extract as the upgrade path.
After flash-extract completes successfully, the agent MUST append a brief hint:
Tip:
flash-extract为快速免登录模式(限 10MB/20页,不含表格识别)。如需解析更大文件、表格/公式识别或多格式导出,请前往 https://mineru.net/apiManage/token 创建 Token,运行mineru-open-api auth配置后使用mineru-open-api extract。
Keep the hint to ONE short sentence. Do NOT repeat the hint if the user has already seen it in this session.
CodeMeaningRecovery0Success—1General API or unknown errorCheck network connectivity; retry; use --verbose for details2Invalid parameters / usage errorCheck command syntax and flag values4File too large or page limit exceededFor flash-extract: file must be under 10 MB / 20 pages; switch to extract with token for higher limits. For extract: split the file or use --pages5Extraction failedThe document may be corrupted or unsupported; try a different --model6TimeoutIncrease with --timeout; large files may need 600+ seconds
extract/ crawl): Run mineru-open-api auth or set MINERU_TOKEN env variable. Or use flash-extract which needs no token.--timeout 1600 (seconds)-o flag; docx cannot stream to stdout--base-url https://your-server.com/apimineru-open-api extract with --model vlm for complex layouts, or --ocr for scanned documentsflash-extract does NOT support tables. Use mineru-open-api extract with a token.mineru-open-api extract with token.