Guides › Integration
API keys
Generate, use, rotate and revoke the keys that give access to the API and the CLI.
Every API call, except trigger webhooks, needs a key. Keys start with dbx_ and act as the person who owns them: they see and change only what that person sees and changes in the app.
Key types#
| Type | Where it comes from | How many | Use it for |
|---|---|---|---|
| Personal key | Settings › Profile › API access | One per person. Generating a new one replaces the previous one. | Scripts, systems and integrations you maintain. |
| Terminal key | Created by doublex login, one per computer | One per login | The CLI on that computer. It lives in the system keychain and you never need to see it. |
Both work the same way in the API. The difference is how they're created and how they're revoked.
Generate your personal key#
- Sign in to the app and open Settings › Profile.
- In the API access section, click Generate API key.
- Copy the key right away. For security, it's shown only once.
After that, the page shows only the end of the key (dbx_••••••••••••a1b2), the creation date and when it was last used.
Use the key#
Send the key in the Authorization header with the Bearer scheme:
curl https://doublex.ai/api/me \
-H "Authorization: Bearer $DOUBLEX_API_KEY"Without a key, or with an invalid or revoked key, the API responds 401.
Rotate and revoke#
| Action | How | Effect |
|---|---|---|
| Rotate your personal key | Profile › API access › ⋯ › Generate new key | The old key stops working immediately. Update everything that uses it. |
| Revoke your personal key | Profile › API access › ⋯ › Revoke key | Everything that uses the key stops working. |
| Disconnect a terminal | Profile › Terminal (CLI) › Connected terminals › Disconnect | The CLI on that computer needs a new doublex login. |
| Sign out from the terminal | doublex logout | Revokes that terminal's key on the server and deletes it from the keychain. If you signed in with your personal key (--api-key), it's only removed from the keychain and stays valid. |
When a person leaves the organization, their keys stop working.
Changing or resetting your password revokes all your keys (the personal one and every terminal's): generate the personal key again and run doublex login on your terminals. A terminal key unused for 90 days also stops working.
What a key can do#
A key has the same permissions as its owner:
- it sees the agents, skills, Brain documents and connectors in the owner's scope (Personal, their teams and the Organization);
- it edits only what the owner can edit in the app;
- it uses the organization's credits, just like usage in the app.
Some actions work only in the browser, even with a valid key:
- generating, rotating or revoking your personal key;
- authorizing a terminal login;
- adding credits to the organization.
Best practices#
- Treat the key like a password: keep it in a secrets vault or an environment variable, never in code or in Git.
- Use the terminal key (
doublex login) on your own computer, and the personal key only on servers and in automations. - If a key leaks, revoke it in your Profile. Nothing it did before is undone, but it stops working immediately.
- The
dbx_prefix exists so secret scanners (like GitHub's) can recognize a key that was published by mistake.
Next steps#
- API overview: request format, errors and streaming.
- CLI authentication: browser login, servers without a browser, and CI.