Authentication and keys
Test and live keys, how to send them, and how to keep them safe.
Every request except GET /v1/health needs an API key, sent as a bearer token:
Authorization: Bearer nxp_live_...Create and revoke keys in the dashboard under Cloud API keys.
Test and live keys
| Key | Prefix | Output | Limits |
|---|---|---|---|
| Test | nxp_test_ | Every PDF carries a "NexPDF Cloud test key" watermark. Free on every account. | 5 MB per file, 20 requests a minute, 1,000 units a month |
| Live | nxp_live_ | Clean output, counted against your plan. | Your plan's limits (see pricing) |
Use test keys in development and CI; they exercise every endpoint with the same validation as live keys. Editing Excel and Word files needs a live key.
Keep keys secret
- A key is shown once, when you create it. NexPDF keeps only a hash, so a lost key cannot be shown again: create a new one.
- Keep keys on your server, in an environment variable or a secret manager. Never put one in a web page, a mobile app or a public repository.
- Use one key per app or environment, so you can revoke one without stopping the others.
- If a key leaks, revoke it in the dashboard. Requests with it stop working within a minute.
Configure the clients
Every client reads the key from NEXPDF_API_KEY and the address from NEXPDF_API_BASE (default
https://api.nexpdf.dev). You can also pass both when you create the client, along with the
timeout (300 seconds by default) and the number of retries (2 by default). See
client libraries.
A client created without a key fails at once with the code missing_api_key, before it sends
anything.