> ## 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.

# Quickstart: Generate Your First PDF with Blink PDF

> Get an API key, make your first POST /v1/render call, and save a PDF to disk — all in under five minutes with curl, Python, or Node.js.

This guide walks you through everything you need to generate your first PDF with Blink PDF. By the end you'll have a working API key, a successful render, and a PDF file saved locally — in about five minutes.

<Steps>
  <Step title="Create your account and get an API key">
    Sign up for a free account at [app.blinkpdf.io/login](https://app.blinkpdf.io/login). The free tier includes **250 render units per month** with no credit card required.

    Once you're logged in:

    1. Open the **API Keys** section of your dashboard.
    2. Click **Create new key**.
    3. Copy the key — it starts with `bp_` and is shown only once.

    <Warning>
      Store your API key somewhere safe immediately. For security reasons, the dashboard will not show the full key again after you navigate away. If you lose it, you'll need to rotate it and update any services using the old key.
    </Warning>
  </Step>

  <Step title="Make your first API call">
    Send a `POST` request to `https://api.blinkpdf.io/v1/render` with your Markdown content in the request body. Replace `bp_xxxxxxxxxxxxxxxxxxxx` with your actual API key.

    <CodeGroup>
      ```bash curl theme={null}
      curl https://api.blinkpdf.io/v1/render \
        --request POST \
        --header 'Accept: application/pdf' \
        --header 'Content-Type: application/json' \
        --header 'x-api-key: bp_xxxxxxxxxxxxxxxxxxxx' \
        --data '{
          "markdown": "# Invoice 0042\n\nHi Jane, thanks for your business!\n\n## What'\''s included\n\n- **Pro plan** subscription\n- Priority support\n\n**Total: $39** — paid on May 23, 2026.",
          "metadata": { "title": "Invoice 0042" }
        }' \
        --output invoice.pdf
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://api.blinkpdf.io/v1/render",
          headers={
              "x-api-key": "bp_xxxxxxxxxxxxxxxxxxxx",
              "Accept": "application/pdf",
              "Content-Type": "application/json",
          },
          json={
              "markdown": (
                  "# Invoice 0042\n\n"
                  "Hi Jane, thanks for your business!\n\n"
                  "## What's included\n\n"
                  "- **Pro plan** subscription\n"
                  "- Priority support\n\n"
                  "**Total: $39** — paid on May 23, 2026."
              ),
              "metadata": {"title": "Invoice 0042"},
          },
      )

      response.raise_for_status()

      with open("invoice.pdf", "wb") as f:
          f.write(response.content)

      print("PDF saved to invoice.pdf")
      print(f"Request ID: {response.headers['X-Request-Id']}")
      ```

      ```javascript Node.js theme={null}
      import fs from "fs";

      const response = await fetch("https://api.blinkpdf.io/v1/render", {
        method: "POST",
        headers: {
          "x-api-key": "bp_xxxxxxxxxxxxxxxxxxxx",
          Accept: "application/pdf",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          markdown:
            "# Invoice 0042\n\n" +
            "Hi Jane, thanks for your business!\n\n" +
            "## What's included\n\n" +
            "- **Pro plan** subscription\n" +
            "- Priority support\n\n" +
            "**Total: $39** — paid on May 23, 2026.",
          metadata: { title: "Invoice 0042" },
        }),
      });

      if (!response.ok) {
        throw new Error(`Render failed: ${response.status} ${response.statusText}`);
      }

      const buffer = Buffer.from(await response.arrayBuffer());
      fs.writeFileSync("invoice.pdf", buffer);

      console.log("PDF saved to invoice.pdf");
      console.log(`Request ID: ${response.headers.get("X-Request-Id")}`);
      ```
    </CodeGroup>

    A successful response looks like this:

    ```http theme={null}
    HTTP/1.1 200 OK
    Content-Type: application/pdf
    X-Request-Id: 4dcbe381-c0e8-4832-9a2f-1b7c0e9d2f5a
    X-Render-Status: ok
    X-Render-Rendered-As-Requested: true
    X-BlinkPDF-Billing: counted
    X-BlinkPDF-Usage-PDFs-This-Period: 4
    ```

    The body is a raw PDF binary. Several response headers give you visibility into every render:

    | Header                              | Description                                                                                      |
    | ----------------------------------- | ------------------------------------------------------------------------------------------------ |
    | `X-Request-Id`                      | Unique request ID — include this when emailing [support@blinkpdf.io](mailto:support@blinkpdf.io) |
    | `X-Render-Status`                   | `ok` or `degraded` depending on warn/error-level diagnostics                                     |
    | `X-Render-Rendered-As-Requested`    | `true` when the PDF matches your Markdown; `false` when errors changed the output                |
    | `X-Render-Diagnostics`              | Base64url JSON array of diagnostics — present only when issues occurred                          |
    | `X-BlinkPDF-Billing`                | Whether the render was billed: `counted`, `deduped-cache`, or `deduped-idempotent`               |
    | `X-BlinkPDF-Usage-PDFs-This-Period` | Render units used in the current billing period                                                  |

    <Info>
      Simple Markdown renders are designed to complete quickly. Remote images, large documents, and network distance can add latency.
    </Info>
  </Step>

  <Step title="Save and verify the PDF">
    If you used the `curl` command above, the `--output invoice.pdf` flag writes the PDF directly to disk. For Python and Node.js, the examples above write `invoice.pdf` to your current working directory.

    Open the file in any PDF viewer to confirm the render. You should see a formatted document with the heading **Invoice 0042**, a bullet list, and the total line — all typeset from the Markdown you sent.

    <Tip>
      Every PDF produced by Blink PDF is **PDF/UA-1 compliant**, meaning it passes accessibility audits and works correctly with screen readers — no extra configuration required.
    </Tip>
  </Step>

  <Step title="Move your API key to an environment variable">
    Before you ship any code, move your API key out of your source files and into an environment variable. Hardcoded keys are a common source of credential leaks.

    ```bash theme={null}
    export BLINKPDF_API_KEY="bp_xxxxxxxxxxxxxxxxxxxx"
    ```

    Then reference it in your code:

    <CodeGroup>
      ```python Python theme={null}
      import os, requests

      response = requests.post(
          "https://api.blinkpdf.io/v1/render",
          headers={"x-api-key": os.environ["BLINKPDF_API_KEY"]},
          json={"markdown": "# Hello, world!"},
      )
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://api.blinkpdf.io/v1/render", {
        method: "POST",
        headers: {
          "x-api-key": process.env.BLINKPDF_API_KEY,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ markdown: "# Hello, world!" }),
      });
      ```
    </CodeGroup>

    See the [Authentication](/authentication) guide for a full security checklist and details on key rotation.
  </Step>
</Steps>

## What to explore next

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Key formats, security best practices, environment variables, and error handling.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Every request parameter, response header, and error code for `POST /v1/render`.
  </Card>

  <Card title="AI & LLM Workflows" icon="robot" href="/guides/ai-llm-workflows">
    Connect OpenAI or Claude output to Blink PDF for fully automated document pipelines.
  </Card>

  <Card title="Plans & Pricing" icon="tag" href="/plans/pricing">
    Compare tiers from Free (250 render units/mo) to Enterprise with custom volume and SLAs.
  </Card>
</CardGroup>
