Skip to main content

API Keys

Use API keys for servers, scripts, CI jobs, and SDK clients. Keep them out of browser code and mobile clients. Create and rotate keys from Dashboard → Credentials → API Keys, the CLI, or the SDK:
API keys authenticate with X-API-Key:
The SDK reads RUNTOOLS_API_KEY automatically:
Or pass a key explicitly:

Session Tokens

Dashboard and CLI login use WorkOS-backed session tokens. Session tokens authenticate with Authorization: Bearer:
The CLI manages those tokens for you:

Environment Variables

.env

Scopes

API key scopes are checked by the API service. Use the narrowest scopes that fit your integration.
API keys are shown once at creation. Store them in a secret manager or environment variable, not in source code.

Rotation

  1. Create a replacement key.
  2. Deploy the new key to your application or CI secret store.
  3. Verify the new key works.
  4. Revoke the old key.

Errors

Authentication failures use normal API error envelopes:
If a request works in the dashboard but fails with an API key, check the key scopes and the organization selected when the key was created.