Keys / Braintrust

BRAINTRUST_API_KEY

The Braintrust key your app logs traces and runs evals with. It's a user API key or a service token.

Expires
you choose at creation, or never; 1 year by default
API
list and delete API keys, no create; create, list and delete service tokens

Get it

Create one on www.braintrust.dev/app/~/configuration/api-keys. The steps aren't recorded yet.

Set it

BRAINTRUST_API_KEY=...

The Python and TypeScript SDKs read it from this variable when you don't pass a key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. For a user API key, create a new one under Settings, API keys. A key has the permissions of the user who creates it, so create it as a user with the same access.
  2. For a service token, create a new one for the same service account under Settings, Service tokens.
  3. Deploy it everywhere that reads BRAINTRUST_API_KEY.
  4. Confirm every service now uses the new key. Last used updates at most once every 10 minutes, so wait well past that with no change before you delete the old key. Deleting revokes it at once.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16