ReplicateDocument to textComing soon

datalab-to/marker

datalab-to/marker is a document to text tool from Replicate that runs in the background and returns structured JSON. Coming soon: listed with its price, not yet open to runs.

This tool is listed but not yet available to run.

Price pending

Pricing

Price pending.

Limits

Runs
In the background
Returns
json
Longest queue wait
3600s
Run deadline
1800s
Largest inline input
1024 KB
Largest input file
500 MB
Largest output
4768 MB
Outputs per run
16

Input

FieldKindDefaultDescription
file requiredtext—Input file. Must be one of: .pdf, .doc, .docx, .ppt, .pptx, .png, .jpg, .jpeg, .webp
modeJSONfastProcessing mode affecting speed and quality. 'fast': lowest latency, preserves most positional information. 'balanced': same as using use_llm. 'accurate': highest quality, slowest, preserves least positional information
use_llmtrue or falsefalseUse an LLM to significantly improve accuracy for tables, forms, inline math, and layout detection. This merges tables across pages, handles complex layouts, and extracts form values. Will increase processing time
paginatetrue or falsefalseAdd page separators to the output. Each page will be separated by a horizontal rule containing the page number in the format: \n\n{PAGE_NUMBER}\n{48 dashes}\n\n
force_ocrtrue or falsefalseForce OCR on all pages even if text is extractable. By default, Marker automatically uses OCR only when needed (e.g., scanned PDFs). Enable this if you see garbled or incorrect text in the output
max_pagesnumber (whole)
1 to …
—Maximum number of pages to process. Cannot be specified if page_range is set - these parameters are mutually exclusive
page_rangetext—Page range to parse, comma separated like 0,5-10,20. Example: '0,2-4' will process pages 0, 2, 3, and 4. Cannot be specified if max_pages is set - these parameters are mutually exclusive
skip_cachetrue or falsefalseBypass the server-side cache and force re-processing. By default, identical requests are cached to save time and cost. Enable this to get fresh results
page_schematext—Structured extraction: Provide a JSON Schema to extract specific fields from your document. When provided, the model extracts only the fields you define and returns them in the 'extraction_schema_json' output field (as a JSON string containing your extracted data plus citation fields showing which parts of the document were used). The 'markdown' and 'json_data' fields will still contain the full document conversion. Example: {"type":"object","properties":{"invoice_number":{"type":"string"},"total":{"type":"number"}}}. See: https://documentation.datalab.to/docs/recipes/structured-extraction/api-overview. Increases cost by 50%
format_linestrue or falsefalseDetect and format inline mathematical expressions and text styles (bold, italic, etc.) in the output. Useful for documents with mathematical notation
save_checkpointtrue or falsefalseSave processing checkpoint for iterative refinement. Checkpoints can be used with the Marker Prompt API to apply custom rules without re-parsing the entire document. Only useful for advanced workflows
disable_ocr_mathtrue or falsefalseDisable recognition of inline mathematical expressions during OCR. By default, math expressions are detected and can be formatted as LaTeX
include_metadatatrue or falsefalseInclude detailed metadata and JSON structure in the output. When enabled, returns json_data (hierarchical document structure with bounding boxes) and metadata (page stats, table of contents). When disabled (default), only returns markdown to reduce response size
additional_configtext—Advanced configuration options as JSON string. Options include: 'disable_links' (remove hyperlinks), 'keep_pageheader_in_output' (preserve headers), 'keep_pagefooter_in_output' (preserve footers), 'filter_blank_pages' (skip empty pages), 'drop_repeated_text' (remove duplicates), and layout/table processing thresholds. Full list at: https://documentation.datalab.to/api-reference/marker
strip_existing_ocrtrue or falsefalseRemove embedded OCR text layer from the PDF and re-run OCR from scratch. Some PDFs have low-quality embedded OCR text; this option lets you regenerate it. Ignored if force_ocr is enabled
segmentation_schematext—JSON Schema for document segmentation. Define segment names and descriptions to identify and extract different sections of the document (e.g., 'Executive Summary', 'Financial Data'). Useful for splitting long documents by section. See: https://documentation.datalab.to/api-reference/marker
block_correction_prompttext—Optional text prompt to guide output improvements. Use this to specify formatting preferences or extraction requirements, e.g., 'Extract all dates in YYYY-MM-DD format' or 'Keep all tables in their original structure'
disable_image_extractiontrue or falsefalseSkip extracting images from the PDF. By default, images are extracted and returned as base64-encoded data in the images field

Same request in code

curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "replicate",
    "model": "datalab-to/marker",
    "input": {
      "file": "<file>"
    }
  }'