← All tools
Convert document format
Documentdocument.convert_format
in: documentout: document
Convert between markdown, html, docx, pdf, epub, latex.
Pricing
- Price
- 0.625 cr / request
Prices in credits (1 credit = $0.01).
Convert Document Format
Convert documents between formats: markdown ↔ HTML ↔ DOCX ↔ PDF ↔ EPUB ↔ LaTeX.
When to use
- Generate PDFs from markdown for reports, invoices, or documentation.
- Export DOCX for users who need to edit in Word.
- Convert to HTML for embedding content in web pages.
- Produce EPUB for e-reader distribution.
Inputs & outputs
| Input modality | Markdown (inline string or URL) |
| Output modality | Document file (GCS URL) |
| Max inline size | 1 MB |
| Max URL input size | 50 MB |
Parameters
| Param | Required | Description |
|---|---|---|
to | yes | Target format — pdf, html, docx, epub, latex |
toc | no | Include a table of contents. Default: false |
Examples
Markdown → PDF with table of contents
{
"type": "document.convert_format",
"input": { "markdown_inline": "# Report\n\n## Section 1\n\nContent here." },
"params": { "to": "pdf", "toc": true }
}
Markdown URL → DOCX
{
"type": "document.convert_format",
"input": { "markdown_url": "gs://infery-prod-media/content/article.md" },
"params": { "to": "docx" }
}
Pricing
Billed per conversion. PDF conversions are slightly higher due to rendering cost. See pricing dashboard for current rates.
Related capabilities
document.extract_text— extract markdown from PDF/DOCX before convertingdocument.render_slides— render markdown as a slide deck instead of a document
Examples
Markdown → PDF with TOC
{
"to": "pdf",
"toc": true
}