Documentation
Quickstart
curl → PDF in 60 seconds. Turn a Markdown string into a themed PDF with one HTTP request.
Prerequisites
- An Inkrun account.
- An API key. In the dashboard go to API & MCP (
https://inkrun.dev/api-mcp), create a key, and copy it — it looks likesk_...and is shown once.
export INKRUN_API_KEY="sk_..." # your key1. Render a PDF
Send Markdown, ask for the PDF back with Accept: application/pdf, and save it:
curl "https://inkrun.dev/api/v1/render" \
-H "Authorization: Bearer $INKRUN_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/pdf" \
-d '{
"template": "quarterly-report",
"markdown": "# Q2 Revenue\n\nStrong quarter — up **12%** QoQ."
}' \
--output report.pdf2. Open it
open report.pdf # macOS (xdg-open on Linux)That's it — a themed, on-brand PDF from Markdown.
Prefer a JSON response + download URL?
Drop the Accept: application/pdf header. You get JSON back, and when S3 is configured the url is a presigned, ready-to-download link:
curl "https://inkrun.dev/api/v1/render" \
-H "Authorization: Bearer $INKRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "markdown": "# Hello\n\nWorld." }'{
"id": "rnd_9f2a…",
"status": "rendered",
"size": 28211,
"url": "https://…s3…/rnd_9f2a.pdf?X-Amz-Signature=…",
"stored": true
}Choose how it looks
Pass any of these in the JSON body (all optional):
| Field | Example | Effect |
|---|---|---|
template | "sales-proposal" | Render with a saved style option (theme + accent + fonts + format). See Templates. |
theme | "editorial" | Render on a raw base theme. Overrides the template's theme. |
format | "Letter" | Page size: A4, Letter, or Legal. |
title | "Q2 Report" | Document title stored with the render (defaults to frontmatter title:). |
Only markdown is required. With nothing else, you get the default theme on A4.
# On a theme directly, US Letter:
curl "https://inkrun.dev/api/v1/render" \
-H "Authorization: Bearer $INKRUN_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/pdf" \
-d '{ "markdown": "# Notes", "theme": "minimal", "format": "Letter" }' \
--output notes.pdfNext steps
- Automate from an AI agent → Connect Claude Desktop, claude.ai, or Claude Code, ChatGPT & more.
- Full REST reference (all fields, errors, templates CRUD) → REST API.
- Brand it — accent colours, fonts, cover pages → Templates & styles.
Keep the key server-sideThe API denies cross-origin browser reads, so don't call it from client JS. Each successful render counts against your monthly quota (Free: 50, Pro: 500).