Skip to content

Authentication

Send your API key with every request. Put it in the authorization header after the word Bearer. Replace YOUR_API_KEY with your key. Keys start with sk_.

authorization: Bearer YOUR_API_KEY

Keys

  1. Create and manage keys in the dashboard on the API keys page. WorkOS issues each key. A key belongs to a workspace or to one member of a workspace.
  2. WorkOS manages key permissions, revoking, and rotation. Use the same dashboard page.

Hobby includes one workspace member. Adding a teammate requires Pro or above. The sole Hobby member can manage workspace API keys.

Keep your key safe

Use these rules to protect your key:

  • Keep it in a secret manager or a local environment file.
  • Never put it in source code, URLs, screenshots, support messages, or logs.

Benchmark returns 401 UNAUTHORIZED when it rejects a missing or invalid key.

Errors

StatusCodeMeaning
401UNAUTHORIZEDThe key is missing or not valid.
402INSUFFICIENT_CREDITSThe workspace does not have enough spendable credits. Pricing details
402USAGE_CAPPEDThe workspace reached its monthly spending limit. Pricing details
403FORBIDDENThe key is not allowed to do this.
403PLAN_UPGRADE_REQUIREDA read-only plan cannot start a refresh. The response includes upgradeUrl for the workspace billing page.
403SUBSCRIPTION_INACTIVEA paid operation needs a current plan. Renew or choose a plan in the workspace billing page.
429RATE_LIMIT_EXCEEDEDToo many requests. Wait, then try again.