Skip to main content
Claude Desktop can use a custom API endpoint through its Third-Party Inference Gateway. Anthropic-compatible providers can connect directly, while GPT, Codex, and other OpenAI-compatible models require model mapping or protocol routing. This guide shows how to configure third-party GPT and Codex models with CC Switch and BetterToken.
Use the latest versions of Claude Desktop and CC Switch. This setup requires a BetterToken API Key.

Configure a custom API endpoint in Claude Desktop

1

Update Claude Desktop and CC Switch

Update Claude Desktop to the latest version and CC Switch to v3.16.5 or later.
2

Switch to Claude Desktop and add a provider

Open CC Switch. Select the Claude Desktop icon in the top toolbar, then click + in the upper-right corner to add a provider.
Switch to Claude Desktop in CC Switch and click the plus button in the upper-right corner to add a provider.
3

Fill in the basic fields

Enter the following values:
  • Provider Name: BetterToken-codex
  • API Key: your BetterToken API Key
  • API Endpoint: https://bettertoken.ai
CC Switch provider editor with BetterToken-codex, API Key, and API Endpoint fields.
4

Set the model mappings

Set API Format to OpenAI Responses API (Requires routing), then click Fetch Models.Use the mappings shown below and keep Declare 1M enabled:
CC Switch with OpenAI Responses API selected and mappings configured for Sonnet, Opus, Fable, and Haiku.
Use model IDs currently available in the GPT provider of the model plaza.
5

Save, switch, and enable the proxy

After saving the provider, return to the Claude Desktop provider list:
  1. Select your new BetterToken-codex provider until it shows In use.
  2. Turn on the proxy switch in the upper-left corner.
BetterToken-codex is active in CC Switch and the proxy switch in the upper-left corner is enabled.
6

Restart Claude Desktop and choose a model

Quit Claude Desktop completely, then open it again. Gateway in the lower-left corner confirms that the configuration is active.Choose the model you need from the model menu in the message box, then start working.
Claude Desktop after restart, showing Gateway in the lower-left corner and the model selection menu.

Troubleshooting

Gateway does not appear in Claude Desktop

Check that BetterToken-codex is set to In use in CC Switch and the proxy switch is on. Quit Claude Desktop completely and open it again.

The model list is empty

Open the provider editor, click Fetch Models, and confirm that the model mappings were saved. Use a model ID from the GPT provider in the model plaza, then restart Claude Desktop.

401 or Unauthorized

Confirm that you entered a BetterToken API Key. Save the provider, re-enable the proxy, and restart Claude Desktop after replacing the key.

Requests are not sent through BetterToken

Confirm that BetterToken-codex, rather than Claude Desktop Official, is active and that the proxy switch in the upper-left corner remains enabled.