Comparison
When to use an API key
Use your API key when:- You call the API from a backend you control (server, cron job, script).
- You want one credential that does not expire (until you rotate it).
- You need to create or revoke short-lived tokens (token management requires the API key).
Example: request with API key
You can send the key in theAuthorization header or in x-api-key:
When to use an API token (short-lived)
Use a short-lived API token when:- You need to give a client (e.g. frontend, mobile app, partner service) access without sharing your main API key.
- You want a credential that expires and optionally has a request limit.
- You issue tokens from your backend and the client only holds the token.
Example: create a token, then call the API with it
Step 1 — Create a token (with your API key):token (JWT). Store it securely; it is returned only once.
Step 2 — Call any endpoint with the token (Bearer only):
Summary
- API key: Long-lived, from the dashboard. Use
Authorization: YOUR_API_KEYorx-api-key: YOUR_API_KEY. Use it on the server and for creating tokens. - API token: Short-lived JWT from
/api/2/auth/tokens. Use onlyAuthorization: Bearer <token>. Use it for clients that should not see your API key.
Generate API key
Get your static API key from the dashboard
Auth Tokens API
Create, list, and revoke short-lived tokens