| Method | Header | When to use |
|---|---|---|
| API Key | x-api-key: pk_live_… | Server-to-server, scripts, backend integrations |
| Bearer JWT | Authorization: Bearer <token> | First-party browser apps that already have a Clerk session |
api.agntix.ai — internal service URLs are not exposed.
Method 1 — API Keys (recommended)
API keys are scoped to an organization and may be limited to specific features (read-only, voice-only, etc.) at creation time.Create
Open Settings → API Keys in the dashboard and click Create key. Pick a name, the scopes you want, then copy the value. The key is shown once. You can also create keys programmatically:Use
Pass the key in thex-api-key header on every request:
Rotate
Keys do not expire, but you can rotate at any time:- Create a new key with the same scopes.
- Roll your service over to the new key.
- Delete the old key from the dashboard — the deletion is effective immediately.
Method 2 — Bearer JWT (Clerk session)
If you’re building a first-party dashboard and the user is already signed in with Clerk, send their session JWT instead of an API key:Getting a JWT in the browser
If you’re using the official Clerk SDK:Permissions & errors
| Status | Meaning |
|---|---|
200/201 | Authenticated and authorized |
401 Unauthorized | Missing or invalid auth header |
403 Forbidden | Authenticated, but the key/JWT lacks the required permission |
Security best practices
Rotate keys quarterly
Use the dashboard’s bulk rotation tool, or wire CI/CD to do it on a schedule.
Scope down
Issue a separate key per service with only the features it actually needs.
Use Bearer JWTs in the browser
Browser code never holds a long-lived API key.
Monitor usage
The dashboard’s API Keys page shows last-used timestamp per key — purge stale ones.