Call it
curl https://api.peume.com/v1/call/parse-file-to-markdown \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"file_url": "your file url"
}
}'const res = await fetch("https://api.peume.com/v1/call/parse-file-to-markdown", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"file_url": "your file url"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/parse-file-to-markdown",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"file_url": "your file url"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: parse-file-to-markdown.
Parameters
file_urlRequiredstringPublic https:// URL of the file to parse (up to 25MB — e.g. a presigned S3 link or a file-system byte link). fetches it server-side and relays the bytes to.
extensionstringFile-type hint (e.g. 'pdf', 'docx', 'xlsx') for when the URL or its Content-Type does not reveal the format.
ocrbooleanWhen true, detect and OCR images embedded in PDF pages (scanned documents). Off by default. Billed 1 credit plus 1 per page OCR recovers; holds 51 credits (see ocr_ran in the output).
includeLinksbooleanPreserve hyperlinks in the Markdown output. Default true.
includeImagesbooleanInclude image references in the Markdown output. Default false.
shortenBase64ImagesbooleanTruncate inline base64 image payloads to keep the output small. Default true.
useMainContentOnlybooleanBest-effort, HTML-like files only: ask to keep the main content and drop headers, footers, sidebars, and navigation. It is a heuristic, so some of that chrome can stay in the output. Default false.
includeNumberedPagesbooleanStart each PDF page in the Markdown with a `<!-- page N -->` line (N = the original 1-based page number). Default false. Such responses are never served from cache.
pdfobjectParse only a page range of a PDF. With ocr: true, OCR runs (and bills) only inside the range, and the hold is 1 credit plus 1 per page of start..end.
