Setup guide

Provider setup guide

Browse setup steps and troubleshooting by tool.

Provider setup guide/CC-Switch Codex

CC-Switch Codex

This page talks about managing Codex Providers through CC Switch. It is not the same as direct configuration with the Codex client or Codex CLI: the focus here is to first maintain the providers in CC Switch, and then apply them to Codex.

What this page explains

Codex usually operates through OpenAI or OpenAI-compatible interfaces, so focus on checking three items: Base URL, Key, and model name. Whether the Base URL needs to include /v1depends on what is displayed in the provider's backend.

Confirmation before starting

Things to confirmHow to viewWhy
Codex can open normallyFirst, confirm that the Codex CLI or the corresponding client itself can runCC Switch does not install Codex for you
The provider supports OpenAI-compatible interfacesThe backend can show API address, Base URL, OpenAI compatibility, and other instructionsCodex needs to be able to request the compatible interface
The model can be used in Codex scenariosThe available model name can be seen in the backend model listDo not put Claude/Gemini model names into Codex
Key status is normalThe backend token is not expired, not disabled, and the balance is normalMost 401 errors should start by checking the Key

How to fill in the fields

SettingFilling MethodAttention Beginners
Provider NameWrite the provider's name or usageFor example, 'Main OpenAI-compatible provider'
Target Tool / PresetSelect Codex or OpenAI/Codex-related presetsDo not select Claude Code or Gemini
Base URLCopy the API link provided by the provider's backendGenerally, it is the API address provided by the provider; whether to include /v1 follow the backend example
API KeyCopy the complete keyDo not add extra spaces before or after, do not copy it as a note name
Model NameCopy the backend model list exactlyIf obtaining the model list fails, manually add it, still copying the backend name exactly

Apply to Codex

  1. Open CC Switch and go to the Provider management area.
  2. Add a new provider, or choose an existing OpenAI-compatible provider.
  3. Select Codex or OpenAI/Codex-related presets as the target tool.
  4. Fill in the Base URL, API Key, and model name, and save.
  5. Execute Apply / Switch to apply this Provider to Codex.
  6. Close the current terminal window and reopen it, then test again.

Test whether it works

First test the request with the shortest question to see if it can go through. After the test is successful, proceed to use it in the real project.

Codex Minimal Test
codex "Please reply only: CC-Switch Codex is active"
If the returned model does not exist, first check the model name; if the return is unauthorized, first check the Key; if the connection times out, first check the Base URL and the network.