SpecifyDocs

convert_markdown_to_pdf

tools/call

Typeset Markdown as a PDF and save it in Files. Each run uses credits: call without maxCredits to see the price and your balance, then call again with maxCredits to run it. Returns the saved file's Files id when the job finishes, or a jobId to read with convert_job.

Scopes

execute:convert

Each run spends credits. The key's owner must still hold Run processing when it is used. A job the person or another key started also needs read:files to read. A Convert request or output is never a Design file, so the Files rule for Design files (read:design) does not apply.

Inputs

markdownstringRequired
Markdown document, as text. At most 900 KB.
titlestring
The document title and file name. Defaults to Document.
paper"a4" | "letter"
Paper size.
margins"compact" | "normal" | "relaxed"
Page margins.
pageNumbersboolean
Print page numbers in the footer.
maxCreditsinteger
The most credits this job may use. Without it the tool only says what the job costs and spends nothing.
idempotencyKeystring
Send the same key when you retry, and the first job is returned instead of a second.

Returns

Without maxCredits: the price in credits, your balance and whether it is enough; nothing is spent. With maxCredits: the job's state, the credits it used and the saved file's Files id, or the jobId while it still runs. A call returns content[0].text with the JSON result and structuredContent.result with the same value.

Listed when

The key holds execute:convert. Each job's tool is listed once the job is set up.