About this endpoint
What it does
Converts one document — Word, Excel, PowerPoint, OpenDocument, EPUB, RTF, text-based PDF, CSV/TSV, HTML, JSON, XML or plain text — into Markdown. Send the file's name and its bytes as base64; you get back the Markdown plus the detected format and the input and output sizes. No OCR is done and the document is not sent to an external AI model.
Files can be up to 3 MiB (5 MiB for the whole JSON request, base64 included). Capacity is shared across all buyers: 30 requests per minute and 10,000 per UTC day; on 429, wait the Retry-After seconds.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | The file's name, 1–255 characters, ending in a supported extension — the extension decides how the file is read. Supported: csv, doc, docm, docx, epub, htm, html, json, md, odp, ods, odt, pdf, pot, pps, ppsm, ppsx, ppt, pptm, pptx, rtf, tsv, txt, xls, xlsb, xlsm, xlsx, xml. Paths and control characters are stripped; HTML markup in the name is rejected. |
contentBase64 | string (base64) | Yes | The file's bytes as standard padded base64; ASCII spaces, tabs and line breaks are allowed, other invisible characters are rejected. At most 3 MiB once decoded. Text formats must be UTF-8. |
Response
A JSON object with the converted Markdown and details about the conversion.
| Field | Type | Description |
|---|---|---|
markdown | string | The document converted to Markdown, up to 5 MiB. Treat it as untrusted content if you render it as HTML. |
format | string | Format the file was read as — its lower-case extension, e.g. csv, docx, pdf. |
filename | string | Your filename with any folder path and control characters removed. |
inputBytes | integer | Size of the decoded input file, in bytes. |
outputBytes | integer | Size of markdown in bytes (UTF-8). |
ocrUsed | boolean | Always false: no OCR is run, so scanned pages are not read. |
How formats convert
| Format | Result |
|---|---|
csv, tsv, xls, xlsx, xlsm, xlsb, ods | Markdown tables. The first row is the header; short rows are padded and extra columns get numbered headers. |
pdf | Text with its line breaks kept; no headings are guessed. Image-only (scanned) PDFs return OCR_REQUIRED. |
json | The JSON, pretty-printed in a json code block. |
rtf | Text with bold formatting kept. |
html, htm | Readable text only — headings, lists, tables and links are not kept as Markdown. Scripts and styles are dropped. |
txt, md, xml | The text as-is. |
Errors
| Status | error | Meaning |
|---|---|---|
| 400 | INVALID_JSON | The request body isn't valid JSON. |
| 4xx | INVALID_BASE64 | contentBase64 isn't valid padded base64. |
| 413 | — | File over 3 MiB decoded, request over 5 MiB, or Markdown over 5 MiB. |
| 422 | UNSUPPORTED_FORMAT | The extension isn't one of the supported formats. |
| 422 | EMPTY_DOCUMENT | The file has no readable text. |
| 422 | OCR_REQUIRED | A PDF with only images (scanned); it needs OCR, which isn't offered. |
| 4xx | CORRUPT_FILE | The file is damaged or not the format its extension says. |
| 4xx | — | The file is password-protected. |
| 429 | — | Shared rate limit reached; retry after Retry-After seconds. |



