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.

Every request to the Blink PDF API must include an API key. Blink PDF uses Bearer token authentication — you pass your key in the Authorization header of each HTTP request. There are no sessions, cookies, or OAuth flows to manage.

Get your API key

API keys are created and managed in the Blink PDF dashboard.
1

Log in to your dashboard

Go to app.blinkpdf.io and sign in. If you don’t have an account yet, sign up for free — no credit card required.
2

Open the API Keys section

From the dashboard sidebar, click API Keys. Any keys you’ve already created are listed here (the secret portion is masked after creation).
3

Create a new key

Click Create new key, give it a descriptive name (for example, production-invoices or staging-test), and confirm. Your full API key is displayed once — copy it now.
Never share or expose your API key. Treat it like a password. If you accidentally commit a key to a public repository or expose it in client-side code, rotate it immediately from the dashboard — your old key will stop working the moment you do.

Pass your key in requests

Include your API key as a Bearer token in the Authorization header of every request:
Authorization: Bearer sk_live_...
Here’s a complete example:
curl
curl -X POST https://api.blinkpdf.io/v1/render \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello, world!"}'

Key format

Production API keys always start with the prefix sk_live_ followed by a unique alphanumeric string. If your key doesn’t start with sk_live_, double-check that you copied the full key from the dashboard.
PrefixEnvironment
sk_live_Production
All keys are scoped to your account and inherit your plan’s rate limits and monthly render quota.

Use environment variables

Never hardcode your API key in source files. Store it in an environment variable and read it at runtime. This prevents accidental exposure through version control, logs, or error messages.

Set the environment variable

export BLINKPDF_API_KEY="sk_live_..."
For persistent configuration, add this line to your shell profile (.bashrc, .zshrc) or use a secrets manager like AWS Secrets Manager, HashiCorp Vault, or your CI/CD platform’s secret store.

Read it in your code

import os
import requests

api_key = os.environ["BLINKPDF_API_KEY"]  # Raises KeyError if not set

response = requests.post(
    "https://api.blinkpdf.io/v1/render",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json={"markdown": "# Hello, world!"},
)

response.raise_for_status()

Common authentication errors

401 Unauthorized

You’ll receive a 401 response if the Authorization header is missing, malformed, or contains an invalid key.
HTTP/1.1 401 Unauthorized
Common causes and fixes:
CauseFix
Header not included in the requestAdd Authorization: Bearer sk_live_... to every request
Key was rotated or deletedCreate a new key in the dashboard and update your configuration
Key copied with extra whitespaceTrim leading/trailing spaces from the key string
Bearer prefix missingEnsure the header value is Bearer sk_live_..., not just sk_live_...

403 Forbidden

A 403 response means your API key is valid, but your account is not permitted to complete this specific request — most commonly because you’ve exceeded your plan’s monthly render quota.
HTTP/1.1 403 Forbidden
Common causes and fixes:
CauseFix
Monthly render quota exhaustedUpgrade your plan or wait for the quota to reset at the start of your billing cycle
Request exceeds plan-level limitsReview your current plan limits in the dashboard
You can monitor your remaining quota and usage at any time from the Usage section of your dashboard.

Security best practices

  • Rotate keys regularly. Create a new key and retire the old one on a schedule, or any time team membership changes.
  • Use one key per environment. Maintain separate keys for development, staging, and production so you can rotate or revoke them independently.
  • Use one key per service. If multiple services call the Blink PDF API, give each its own key. This limits the blast radius if one key is compromised.
  • Never log the key. Avoid printing the full Authorization header in application logs or error messages.
  • Restrict access at the infrastructure level. Where possible, use a secrets manager or environment injection rather than .env files checked into source control.

Next steps

Quickstart

If you haven’t made your first API call yet, start here.

API Reference

Explore all parameters and headers for the POST /v1/render endpoint.