API key setup
Keys are created and edited in Dashboard > API Keys. A key has a name, a channel, a permission for Premium fallback and an optional expiry date. Premium is the default; Cheap is chosen explicitly, with or without Premium fallback.
Creating keys
- Open Dashboard > API Keys.
- Click Create Key, type a name and pick the mode: Premium, Cheap, or Cheap + Premium fallback.
- If needed, set an end date in the future, then copy the finished key into your client.
- The name, channel, Premium fallback and expiry are changed through Edit. The catalog tab has no effect on the key.
Key format
Every codexkey key looks like this:
sk_cdx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThe sk_cdx_ prefix shows that this is a codexkey key.
Per-key controls
The dashboard key API accepts the fields name, channel, fallback_premium and expires_at. Request limits, budgets, model lists, IP filters and IDE restrictions cannot be configured for a key through it.
Channel modes
- Premium: channel=premium, fallback_premium=false. If channel is left out when the key is created, Premium is selected.
- Cheap: channel=cheap, fallback_premium=false. Premium fallback is not allowed for such a key.
- Cheap + Premium fallback: channel=cheap, fallback_premium=true. The provider decides when to use the fallback; a request served on Premium can cost more.
For the auto_premium, auto_cheap and max modes, channel prices and channel errors, see the Premium and Cheap channels page.
Model availability
Before choosing an ID, look at the catalog for your key's channel. If access to the channel or model is closed, an error comes back; we promise neither a retry schedule nor extra capacity.
Expiry
expires_at needs a date in the future. To create a key without an expiry, leave the field empty. An expiry that is already set cannot be removed through the current edit API.
Client configuration
The key goes in the supported Anthropic or OpenAI headers. The channel and Premium fallback are set on the key itself, not in the body of the model request.
Rotating keys
To rotate a key without downtime:
- Create a new key with the same configuration.
- Switch the application to the new key.
- Verify the new key is working.
- Delete the old key after checking the replacement.
During the switchover, both keys are valid at the same time.
Deleting keys
A deleted key stops working at once and cannot be restored.
Deletion cannot be undone. Before you remove the old key, make sure your clients already run on the new one.