Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.blinkpdf.io/llms.txt

Use this file to discover all available pages before exploring further.

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. 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.
Blink PDF operates with zero data retention — your Markdown and generated PDFs are never stored on our servers. This makes the pipeline safe for sensitive AI outputs such as legal summaries, financial analyses, and medical drafts.

Basic Pattern

LLM API → Markdown string → POST /v1/render → PDF binary → save / send
Every example below follows this pattern. Swap in any LLM provider; only the first step changes.

Code Examples

import openai
import requests

client = openai.OpenAI(api_key="sk-...")

# Step 1: Ask the model to generate a Markdown report
completion = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {
            "role": "system",
            "content": (
                "You are a professional analyst. "
                "Respond with a well-structured Markdown report only — "
                "no commentary outside the document."
            ),
        },
        {
            "role": "user",
            "content": "Write a Q3 2024 performance summary for an e-commerce business.",
        },
    ],
)

markdown_content = completion.choices[0].message.content

# Step 2: Render the Markdown to PDF
response = requests.post(
    "https://api.blinkpdf.io/v1/render",
    headers={
        "Authorization": "Bearer sk_live_...",
        "Content-Type": "application/json",
    },
    json={
        "markdown": markdown_content,
        "metadata": {"title": "Q3 2024 Performance Summary"},
    },
)

response.raise_for_status()

# Step 3: Save the PDF
with open("q3_summary.pdf", "wb") as f:
    f.write(response.content)

render_ms = response.headers.get("X-Render-Ms")
request_id = response.headers.get("X-Request-Id")
print(f"PDF saved — rendered in {render_ms}ms (request ID: {request_id})")

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:
Respond with a complete Markdown document only.
- Start with a single H1 title.
- Use H2 and H3 for sections.
- Use tables for structured comparisons.
- Do not include code fences, commentary, or apologies outside the document.
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 the X-Request-Id header returned by each render call alongside your document record. It makes debugging and support requests significantly faster — you can reference the exact render that produced a given PDF.

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

PlanRate LimitBest For
Free5/minPrototyping LLM-to-PDF pipelines
Starter ($12/mo)30/minSide projects, low-volume agents
Pro ($39/mo)120/minProduction AI apps, daily reporting
Business ($149/mo)600/minHigh-frequency agentic workflows
Scale ($999/mo)~5,000/minEnterprise AI document platforms
All plans include zero-retention processing. No Markdown content or rendered PDFs are stored on Blink PDF infrastructure at any tier.