Skip to main content
Large language models like OpenAI’s GPT-4 and Anthropic’s Claude produce Markdown natively, which means you can pipe their output straight into Blink PDF without any intermediate transformation step. This makes Blink PDF a natural fit for AI-powered document generation: your model writes the content, and you get a polished, shareable PDF in under 100ms.
Building inside an AI agent like Cursor, Claude Code, or Codex? Skip the glue code entirely — connect the Blink PDF MCP server with one mcp.json paste and the same bp_ key. The tool list includes render_pdf and fill (inspect_form, fill_form). The patterns below cover the REST-based pipeline.
LLMs are trained on Markdown-heavy corpora and default to it whenever they generate structured content — reports, summaries, analyses, and proposals all arrive pre-formatted with headings, bullet lists, bold text, and tables. Blink PDF’s /v1/render endpoint accepts that Markdown directly as a JSON string, so the integration is essentially zero-glue:
  1. Prompt your model to produce a Markdown document.
  2. Take response.choices[0].message.content (or the Claude equivalent).
  3. POST it to /v1/render.
  4. Receive a ready-to-use PDF binary.
Your Markdown input is never persisted — it’s processed in memory and discarded when the response closes. REST returns the PDF on the response. Staged assets last 24 hours. MCP download files default to 24 hours unless you opt in to keep them. This makes the REST pipeline safe for sensitive AI outputs such as legal summaries, financial analyses, and medical drafts. See Zero Retention.

Basic Pattern

Every example below follows this pattern. Swap in any LLM provider; only the first step changes.

Code Examples

Agentic Workflows

When you’re building autonomous agents that produce multiple documents across a workflow run, a few patterns help you stay efficient and within your rate limits.

Async Batch Generation

If your agent produces several reports in one run, fire the render requests concurrently rather than sequentially. At Pro plan (120 req/min) you can sustain roughly two renders per second without hitting limits. See the Batch Processing guide for a full async example.

Prompt Engineering for Clean PDFs

Guide the model to produce render-ready Markdown by adding explicit instructions in your system prompt:
This prevents preamble text like “Sure, here’s your report:” from appearing in the rendered PDF.

Streaming + Buffering

If you use OpenAI’s streaming API to display content progressively in a UI, buffer the full completion before sending it to /v1/render. Blink PDF requires the complete Markdown document in a single request.
Store X-Request-Id, X-Render-Status, and X-Render-Rendered-As-Requested alongside each document record. Decode X-Render-Diagnostics when you need the full list of renderer warnings and errors — see the API overview.

Connecting to Notion, Obsidian, and Tiptap

Blink PDF integrates well with editor-based AI workflows:
  • Notion AI — Export Notion page content as Markdown via the Notion API, then render with Blink PDF to produce a shareable PDF snapshot.
  • Obsidian — Use the Obsidian Local REST API plugin or a community plugin to pipe vault notes to /v1/render on demand.
  • Tiptap — Convert Tiptap’s JSON document model to Markdown using @tiptap/extension-markdown, then pass the string directly to Blink PDF.

Plan Considerations

On every plan, your Markdown input is never persisted. REST returns the PDF on the response; staged assets last 24 hours; MCP can keep a PDF if you opt in. See Pricing for render-unit allowances and stored-PDF caps.