Keys / WorkOS

WORKOS_API_KEY

The WorkOS secret key your server calls the WorkOS API with. It can make any API request in its environment.

Starts with
sk_
Expires
the docs don't say
API
create and expire, with the Platform API for platform partners

Get it

Create one on dashboard.workos.com/api-keys. The steps aren't recorded yet.

Set it

WORKOS_API_KEY=sk_...

The Node.js and Python SDKs and AuthKit for Next.js read it when you don't pass a key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. On the API Keys page, create a new key for the same environment. A production key is shown only once.
  2. Deploy it everywhere that reads WORKOS_API_KEY.
  3. Check that nothing still uses the old key, then remove it in the WorkOS Dashboard.

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