Document parsing · PDF / Word / Excel / CSV ● Available

file-md-json API

Parse PDF, DOCX, XLSX, and CSV files into Markdown text and structured md-json. Upload a file, submit a parse task, and fetch the result by task_id — up to 10 MB per file.

Tool ID
file-md-json
Formats
PDF / DOCX / XLSX / CSV
File limit
10 MB
Pricing
$0.001 / call
Catalog verified

What is file-md-json?

file-md-json is a document-parsing tool in the Roko tool services: upload a PDF, Word (DOCX), Excel (XLSX), or CSV file and get back Markdown text plus a structured md-json result (schema_version 1.0), ready for downstream search, summarization, or LLM pipelines.

Parsing runs on the Cloudflare Markdown Conversion channel, suited to batch-structuring contracts, reports, and manuals. The upload response returns id; pass it as input.file_id to invoke, which returns a task_id for result retrieval.

The tool bills per call at $0.001 per parsed file; failed tasks are not billed. Calls require a Roko API key with the tool's invocation permission enabled on the token.

Core capabilities

Four document formats

PDF, DOCX, XLSX, and CSV all parse, covering common office and data files.

Dual-format output

One parse returns both Markdown text and md-json structure; choose formats in options.

Async tasks with idempotency

invoke accepts a unique Idempotency-Key; replays never double-bill. Results are queried by task_id.

Per-call billing

$0.001 per file, no minimum spend; failed parses are not billed.

Supported input formats

Extensions come from the current tool-service executor definition; 10 MB max per file, one file per upload.

FormatNotesLimits
PDFPDF documentsParsed page by page into Markdown; scanned PDFs have no OCR
DOCXWord documents (Office Open XML)Legacy .doc is unsupported — save as .docx first
XLSXExcel workbooksTables convert to Markdown tables
CSVComma-separated dataConverts to Markdown tables; the local-text tool also handles it

file-md-json pricing

Pricing was verified against the 2026-10-06 Roko production tool catalog snapshot and is billed per successful call; the invocation settlement record is authoritative.

Billing itemPrice
Per parse call$0.001

Cost examples

Parse one PDF1 × $0.001 = $0.001

Routine cost for a single contract or report.

Batch-parse 100 documents100 × $0.001 = $0.10

Typical spend for archival and search workloads; failed tasks are not billed.

Call file-md-json in three steps

The upload response returns id. Pass it as input.file_id to invoke, then fetch the completed result by task_id. Never expose an API key in client-side code.

1. Upload a file

curl https://api.rokoapi.com/v1/tools/file-md-json/files \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@/path/to/report.pdf"

2. Submit the parse task

curl https://api.rokoapi.com/v1/tools/file-md-json/invoke \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: parse-report-0001" \
  -d '{
    "input": { "file_id": "FILE_ID" },
    "options": { "output_formats": ["markdown", "json"] }
  }'

3. Fetch the result

curl https://api.rokoapi.com/v1/tasks/$TASK_ID/result \
  -H "Authorization: Bearer $API_KEY"

invoke returns 202 with a task_id; once parsing completes, read the md-json (schema_version 1.0) from the result endpoint. The Idempotency-Key must be 8–64 characters of letters, digits, underscores, or hyphens; replays with the same key return the original task without re-billing.

Important limitations

  • Up to 10 MB per file, exactly one file per upload.
  • Scanned PDFs have no OCR — text content will be missing from the parse.
  • Legacy binary formats like .doc and .xls are unsupported; convert to DOCX/XLSX first.
  • Task results have a retention window — fetch and store them promptly. Never expose an API key in client-side code.
  • Parse quality depends on document structure; complex layouts, formulas, and nested tables may drift in detail.

file-md-json FAQ

Which file formats does file-md-json support?

Currently PDF, DOCX, XLSX, and CSV, up to 10 MB per file.

How much does file-md-json cost?

The 2026-10-06 production catalog lists $0.001 per call. Failed parses are not billed; the settlement record at invocation is authoritative.

What fields are in the md-json output?

The result JSON includes schema_version, markdown (full Markdown text), structure_source, capabilities (OCR, page references, bounding boxes, structured tables flags), and a warnings array.

How is it different from text-md-json?

text-md-json handles plain-text and code files (txt/md/csv/source code) with local conversion at a lower price ($0.0001/call); file-md-json parses binary documents like PDF/DOCX/XLSX through the conversion channel at $0.001/call.

Can I parse files in batch?

Yes. Each call parses one file; loop uploads and submissions client-side, using a distinct Idempotency-Key per task.

Why do I get a 403 or permission error?

Tool calls need an API key with the tool's invocation permission enabled. Enable file-md-json for your token in the console and retry.