# Configure Model Provider Source: https://ofox.ai/docs/integrations/codex/model-provider We recommend using [CC Switch](https://github.com/farion1231/cc-switch?utm=ofox_ai) to complete the configuration — an open-source provider management tool with a visual interface, no need to manually edit JSON or environment variables. > **Set up faster with Ofox Desktop.** On an Apple silicon Mac, Desktop can detect this tool, back up its current configuration, and apply an Ofox API key and compatible model. [Open Ofox Desktop](https://ofox.ai/desktop). ## 1. Install CC Switch ### macOS ```bash brew install --cask cc-switch ``` Or go to [Releases](https://github.com/farion1231/cc-switch/releases?utm=ofox_ai) to download the `.dmg` for manual installation. ### Windows Go to [Releases](https://github.com/farion1231/cc-switch/releases?utm=ofox_ai) to download the `.msi` installer. ### Linux ```bash # Debian / Ubuntu sudo dpkg -i CC-Switch-*.deb # Fedora / RHEL sudo rpm -i CC-Switch-*.rpm # AppImage chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage ``` Supports macOS 12+, Windows 10+, Ubuntu 22.04+ / Debian 11+ / Fedora 34+ ## 2. Add OfoxAI Provider ### Step 1: Add a New Provider Switch to the **Codex** tab at the top, then click the **+** button in the top-right corner. ![CC Switch add provider](https://ofox.ai/images/integrations/cc-switch-codex-step1.png) ### Step 2: Fill in the Configuration Fill in the fields as shown below, then click **+ Add** to complete. ![CC Switch provider configuration](https://ofox.ai/images/integrations/cc-switch-codex-config.png) | Field | Value | Description | | --- | --- | --- | | ❶ Provider Name | `ofoxai-codex` | Custom name for easy identification | | ❷ Website URL | `https://ofox.ai` | Provider website | | ❸ API Key | Your OfoxAI API Key | Get it at [app.ofox.ai](https://app.ofox.ai/manage/api-keys?utm=ofox_ai) | | ❹ Request URL | `https://api.ofox.ai/v1` | Do not add a trailing slash | | ❺ API Format | `OpenAI Compatible` | Select OpenAI compatible format | | ❻ Write to Global Config | ✅ Checked | Writes to global config, applies to all projects | CC Switch automatically writes to the config file — no manual file editing required. ### Step 3: Activate the Provider After adding, go back to the list, select `ofoxai-codex`, and click **Use**. Make sure **Write to global config** is checked — the settings will be automatically written to `config.toml`. ![CC Switch activate provider](https://ofox.ai/images/integrations/cc-switch-codex-step3.png) ## 3. Verify Configuration ```bash codex "hello" ``` ![Codex CLI running](https://ofox.ai/screenshots/codex/03-run.png) A normal AI response confirms the configuration is working. ## 4. Specify a Model ```bash codex --model "Refactor this function" ``` Codex CLI uses the **OpenAI Responses API** (`wire_api = "responses"`). Not all models support this format. When selecting a model, confirm it supports the **Responses** protocol on the [OfoxAI Model Marketplace](https://ofox.ai/models) — otherwise you will get an error. For recommended models, see the [OfoxAI Model Marketplace](https://ofox.ai/models?utm=ofox_ai). ## Troubleshooting **Q: "Authentication error" message** Confirm the API Key is correctly filled in and the request URL has no trailing slash. **Q: Connection timeout** Verify the request URL is `https://api.ofox.ai/v1` with no trailing slash.