Test mode
Build against test keys that render real documents for free and keep their data apart from live mode, then switch keys to go live.
Every Druckling workspace has two modes, live and test. Test mode lets you build and check an integration with real renders that cost nothing and never mix with your production data. The API key decides the mode: dr_test_… keys work in test mode, dr_live_… keys in live mode.
What test mode changes
- Renders are free. Test renders never count toward your plan's daily or monthly documents, and quota checks are skipped, so a test request never fails with
429 quota_exceeded. That includes batches: a test batch doesn't have to fit in the documents you have left. - The output doesn't change. Test documents are rendered exactly like live ones: no watermark, the same template version, the same PDF/A or PDF/UA settings and the same e-invoice XML. Files are kept for the same 30 days, and signed links work for the same 7 days.
- Other limits still apply. Rate limits, request size limits and payload validation work the same in both modes. See Plans and limits.
How the mode is chosen
In the API
The key's prefix is the only thing that decides the mode. There's no header or parameter to switch it, so the same code runs in test and live mode: only the key changes. You create keys of either mode under Developers › API keys; see Authentication.
The SDKs tell you which mode a client is in: druckling.mode in TypeScript and client.mode in Python return "test" or "live" based on the key.
In the dashboard
The Test mode switch at the bottom of the sidebar chooses which data the dashboard shows. While it's on, a colored line runs along the top of the page, and documents, batches, request logs and the numbers on Overview and Metrics come from test mode only. Batches you start from the dashboard run in test mode too.
The switch is saved in a cookie (dr_mode) in your browser. It doesn't affect API requests, your API keys or what other members of your team see. The plan meter in the sidebar always shows live usage, because test renders don't count.
What's kept apart
| Resource | How the mode applies |
|---|---|
| Documents | Created in the key's mode, with test_mode set. Lists show only the key's mode. |
| Batches | Created in the key's mode, with test_mode set. Their documents are in the same mode. |
| Share links | Take the mode of their document, shown in test_mode. |
| Webhook endpoints | Each endpoint has one mode, chosen when it's created and fixed after that. A test endpoint receives only test events, and every event has test_mode set. An API key creates endpoints in its own mode and only sees those; the dashboard lists both modes. |
| Embedded editor sessions | Created in the key's mode, with test_mode set. A key can only revoke sessions of its own mode. |
| Request logs | Developers › Logs shows the requests of the dashboard's current mode. |
| Usage | Only live renders count toward your plan. |
These are shared between the modes: templates and their published versions, API keys (the list shows both, with a mode badge), embed settings such as allowed origins, team members, billing and workspace settings.
Templates aren't separated by mode
There's one set of templates per workspace. Publishing a new version changes what latest renders in both modes, whether you publish in the dashboard, through an embedded editor session created with a test key, or through the MCP server with a test key. To try template changes without touching live renders, pin version in your live requests.
Lookups by ID aren't filtered by mode
A key only ever sees objects of its own mode. Lists leave the other mode out, and an ID from the other mode answers 404, as if it didn't exist: documents, batches, share links, webhook endpoints and embedded editor sessions alike.
Go live
Build with a test key
Create a Test key and use it in local development, CI and staging. Choose Render only unless the integration also manages webhooks, reads templates or creates editor sessions.
Test webhooks with a test endpoint
Add a webhook endpoint in test mode that points at your staging or development URL. It receives only test events, so it never sees production documents.
Switch to a live key
Create a Live key with the permission your production service needs and put it in your production environment. Nothing else in your code changes. If you use webhooks, add a live endpoint for your production URL: it has its own signing secret.
Check the mode where it matters
Keep live keys out of development and staging. In webhook handlers and anywhere you act on documents by ID, check test_mode so test data can't trigger production work, such as emailing an invoice to a customer.
E-invoices in test mode
E-invoices render and validate exactly the same way in both modes. A test Factur-X invoice is the same PDF/A-3 with the same embedded XML as a live one, and the EN 16931, XRechnung and Peppol rules are checked just as strictly. That makes test mode a reliable way to check your invoice data before you go live.
Nothing in the PDF or XML marks a test invoice as a test. Treat test invoices as samples, and don't send them to customers or into accounting or e-invoicing networks.