Authentication
To authenticate with the PDFik API, you must provide a valid API key in every request.
Obtaining an API Key
- Log in to your PDFik Dashboard.
- Navigate to Settings > API Keys.
- Click Generate New API Key.
- Copy the secret key immediately. For security reasons, it will not be shown again.
API Key Formats
PDFik API keys use prefix tags to identify the environment:
- Live Mode Keys: Start with
sk_live_(e.g.,sk_live_abc123...). Use these for production PDF generation. Jobs submitted without the test flag count toward your plan's quotas. - Test Mode Keys: Start with
sk_test_(e.g.,sk_test_xyz789...). The prefix labels the key so you can keep sandbox credentials apart — it does not change behavior by itself. Test behavior is requested per job: pass"test": truein the request body to run the full pipeline for free and receive a static sample PDF instead of a real render. See Testing.
Authentication Methods
You must authenticate by passing your API key in the headers.
X-API-Key Header
Pass your API key as the value of the X-API-Key HTTP header.
curl -X POST https://api.pdfik.net/url-to-pdf \
-H "X-API-Key: sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Security Best Practices
[!WARNING] Your API key holds full access to your account and quota. Keep it private.
- Do not hardcode API keys in your repository. Use environment variables (e.g.,
PDFIK_API_KEY). - Never expose keys in client-side code (browsers, mobile applications). All calls should be made from your backend server.
- Rotate keys regularly or immediately if you suspect a leak.