DoubleX AgentesDocs

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#

TypeWhere it comes fromHow manyUse it for
Personal keySettings › Profile › API accessOne per person. Generating a new one replaces the previous one.Scripts, systems and integrations you maintain.
Terminal keyCreated by doublex login, one per computerOne per loginThe 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#

  1. Sign in to the app and open Settings › Profile.
  2. In the API access section, click Generate API key.
  3. 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#

ActionHowEffect
Rotate your personal keyProfile › API access › ⋯ › Generate new keyThe old key stops working immediately. Update everything that uses it.
Revoke your personal keyProfile › API access › ⋯ › Revoke keyEverything that uses the key stops working.
Disconnect a terminalProfile › Terminal (CLI) › Connected terminals › DisconnectThe CLI on that computer needs a new doublex login.
Sign out from the terminaldoublex logoutRevokes 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#