Text parsing · txt / md / csv / code files ● Available

text-md-json API

Convert txt, md, csv, json, yaml, and code files into Markdown and structured md-json. Processed with local logic, up to 10 MB per file, $0.0001 per call.

Tool ID
text-md-json
Types
txt / md / csv / code — 23 extensions
File limit
10 MB
Pricing
$0.0001 / call
Catalog verified

What is text-md-json?

text-md-json is the local text-parsing tool in the Roko tool services: upload txt, md, csv, json, yaml, html, or code files like go, py, js, and ts, and get back Markdown text plus structured md-json (schema_version 1.0).

Processing runs locally on the server: md and txt pass through as Markdown; code, CSV, and JSON are preserved literally inside fenced code blocks without markup interpretation. Ideal for normalizing heterogeneous text assets into searchable, LLM-ready input.

It is one of the cheapest Roko tools: $0.0001 per call, and failed tasks are not billed. Calls require a Roko API key with the tool invocation permission enabled on the token.

Core capabilities

23 text extensions

txt, md, csv, json, yaml, html, and source files like go, py, js, and ts all parse.

Faithful conversion

md/txt pass through as-is; code and data files are preserved literally in fenced code blocks.

Dual-format output

Returns both Markdown text and the md-json structure; choose formats in options.

Rock-bottom unit price

$0.0001 per call, sized for high-frequency, large-scale text normalization.

Supported input types

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

TypeExtensionsHandling
Text & markuptxt, mdPassed through as Markdown
Data filescsv, json, yaml, yml, xmlPreserved literally in fenced code blocks
Web pageshtmlPreserved literally in fenced code blocks
Source codego, py, js, ts, tsx, jsx, css, java, c, cpp, h, rs, sql, shPreserved literally in fenced code blocks

text-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.0001

Cost examples

Parse one code file1 × $0.0001 = $0.0001

Routine per-file cost, effectively negligible.

Normalize 1,000 text files1000 × $0.0001 = $0.10

Typical spend for whole-corpus normalization; failed tasks are not billed.

Call text-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/text-md-json/files \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@/path/to/notes.md"

2. Submit the parse task

curl https://api.rokoapi.com/v1/tools/text-md-json/invoke \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: text-parse-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, one file per upload; the extension must be on the supported list.
  • Code and data files are preserved literally — no semantic reordering or cleaning.
  • Pure binary files (images, PDFs) are out of scope for this tool; use file-md-json.
  • Task results have a retention window — fetch and store them promptly. Never expose an API key in client-side code.
  • md and txt pass through unchanged; the tool does not validate or repair content formatting.

text-md-json FAQ

Which file types does text-md-json support?

23 text extensions: txt, md, csv, json, yaml, yml, xml, html, plus source files like go, py, js, ts, tsx, jsx, css, java, c, cpp, h, rs, sql, and sh.

How much does text-md-json cost?

The 2026-10-06 production catalog lists $0.0001 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 flags, and a warnings array — the same structure as file-md-json.

How is it different from file-md-json?

text-md-json targets text and code files with local conversion at $0.0001/call; file-md-json parses binary documents like PDF/DOCX/XLSX through the conversion channel at $0.001/call.

Will code files be rewritten?

No. Code, CSV, and JSON are preserved literally in fenced code blocks — no rewriting, interpretation, or reformatting.

Why do I get a 403 or permission error?

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