Premium and Cheap channels
codexkey has two channels for reaching models. The channel decides which models a key can see and what a token costs.
Two channels
- Premium: all models, direct access. Set by default on every key.
- Cheap: lower price, one price for any token, but only the models that exist in Cheap.
The list of Cheap models is visible in the catalog.
Key routing modes
The key's routing mode decides which channels it uses: one channel, or both with switching.
| Mode | What it does |
|---|---|
premium | Premium only. The default mode. |
cheap | Cheap only. |
auto_premium | Premium first; after 4 failed attempts in a row the request moves to Cheap. |
auto_cheap | Cheap first; after 4 failed attempts in a row the request moves to Premium. |
max | Maximum capacity: every request is sent to the least loaded channel. |
Billing follows the rate of the channel that answered. A request that moved to Premium is paid at the Premium price.
If the model is in none of the key's channels, the request ends with the error 403 model_not_in_channel and no money is charged.
How to choose a mode
- Open the API Keys section in the dashboard.
- The channel is chosen when the key is created, or changed through Edit.
- The change takes effect within a few seconds.
The auto_premium, auto_cheap and max modes are available when channel switching is enabled for the account. If a mode is not in the list, it is closed to you: contact support.
The "Site chat" key
The chat on the site runs through a service key named "Site chat". Its mode is Cheap, and on failures the request goes to Premium (auto_cheap). Such a key cannot be deleted or reissued.
Prices by channel
- In Premium, input and output tokens have different prices. In Cheap there is one price for any token.
- Each model's prices in both channels are in the catalog: the model page has a Premium / Cheap switch.
- Images and video also depend on the channel; details are in the Images and video section.
Channel errors
| HTTP | code | When |
|---|---|---|
403 | model_not_in_channel | The model is not in the key's channel. Change the key's channel or the model. |
403 | channel_not_allowed | The Cheap channel is closed for your account. |
403 | fallback_not_allowed | Channel switching is not enabled for the account. This concerns the auto_premium, auto_cheap and max modes. |
422 | channel_unavailable | The channel has no models yet. |
422 | invalid_state | The key is revoked. |
The remaining API errors are listed in the error reference.