2026 Latest Guide | The Complete Guide to Connecting Codex to MiniMax Models: Zero-Basis Setup with CC Switch Local Routing
Article introduction: If you are looking for the latest solution for connecting Codex to MiniMax models, this guide will provide you with complete operating instructions. This article explains in detail how to seamlessly connect the MiniMax large language model to the Codex CLI tool through CC Switch's Local Routing feature. Whether you need to solve interface format conversion or want to manage API Keys centrally, this local routing guide based on CC Switch will help you complete the setup quickly.
# 📖 Table of Contents
- Preparation: Environment and Tool Requirements
- Step 1: Add a Codex Provider in CC Switch
- Step 2: Enable Local Routing and Take Over Codex
- Step 3: Switch Providers and Restart Codex
- Advanced: Configuring Other Chat-Format LLM Providers
- Common Issue Troubleshooting (FAQ)
Preparation: Environment and Tool Requirements
Before you start implementing connecting Codex to MiniMax models, please make sure your system meets the following requirements (it is recommended to use CC Switch 3.16.0 or above):
- CC Switch client: installed correctly and can start normally.
- Codex CLI environment: installed and run at least once, ensuring that the
~/.codex/config.tomldirectory structure exists on your local device. - API credentials: you have obtained the API Key provided by MiniMax.
Step 1: Add a Codex Provider in CC Switch
To let Codex recognize MiniMax models, we first need to configure the provider in CC Switch.


- Open the CC Switch client and switch to the Codex tab at the top.
- Click the "+" plus button in the top-right corner to prepare to add a new provider.

- Select MiniMax from the built-in preset list. After selecting the preset, you only need to complete the following two operations:

- Fill in your MiniMax API Key.
- Click Save Provider.

💡 Tip: CC Switch's preset mechanism automatically includes MiniMax's request URL, default model, model menu, and thinking/reasoning parameters for you, greatly simplifying the tedious steps of connecting Codex to MiniMax models.
Step 2: Enable Local Routing and Take Over Codex

Since large models such as MiniMax usually adopt a Chat interface similar to OpenAI's, we need to use CC Switch's local routing feature to perform protocol conversion.
Click the local routing toggle on the MiniMax provider you just configured, and the system will show a prompt: "This provider uses the OpenAI Chat interface format and requires a routing service to work properly. Please start the routing service first".
Follow these steps to configure the routing takeover:


- Go to the Routing page in Settings and expand Local Routing.
- Turn on the master routing switch to start the local service (the default address is usually
127.0.0.1:15721). - Enable Codex takeover: If you only want Codex to use this routing, you can keep the routing switches for Claude and Gemini off.
🔒 Security advantage: After the takeover is complete, CC Switch points Codex's live configuration directly at the local routing service and manages authentication with placeholders. Your real MiniMax API Key is safely stored in CC Switch's Provider configuration and is automatically injected by the local routing when forwarding requests, avoiding the risk of the Key being exposed in the Codex configuration file.
Step 3: Switch Providers and Restart Codex
Return to the Codex provider list, click the MiniMax provider you configured, and select Enable. Note: If you see a "routing required" tag, it means this provider can only be used while the routing service is running. If the routing service is not started, CC Switch will show a pop-up warning.
⚠️ Key operation: After switching, it is strongly recommended to restart the current Codex session!
Here's why:
- Refresh the model list: If you don't restart, Codex may cache old data, causing the model menu to not refresh and still display the model list from the old configuration.
- Load the JSON catalog: After the
model_catalog_jsonfile is generated, Codex's/modelmenu usually requires a new process to complete the reload.

After restarting and entering the Codex CLI, you can type the /model command to check whether the currently enabled model has been successfully switched to the MiniMax preset you need (for example, the MiniMax 2.7 series models).
Advanced: Configuring Other Chat-Format LLM Providers
Besides connecting Codex to MiniMax models, the mainstream AI large models currently popular in China (such as Kimi, DeepSeek, SiliconFlow, etc.) can also be quickly configured in CC Switch:
- Prefer built-in presets: Common Chat-format providers already have built-in presets in CC Switch — just select them directly.
- Custom configuration: Only when your needed provider is not in the preset list should you choose "Custom Configuration". In that case, fill in the API Key, Base URL, and available models according to the official API documentation, and be sure to set the "API Format" to
OpenAI Chat Completions (routing required). - Direct connection mode: If the upstream API provider natively supports the
OpenAI Responses APIprotocol, you don't need to enable local routing mapping. CC Switch can connect directly via the Responses protocol without Chat conversion.
Common Issue Troubleshooting (FAQ)
To ensure you can quickly solve problems when looking up tutorials on search engines, we've compiled the following common error troubleshooting guide:
1. Codex reports a 404 error or says it can't find /responses — what should I do?
- Cause investigation: This usually happens because you didn't enable Codex routing takeover in CC Switch, or you manually filled in the upstream Chat base URL in the Codex configuration file.
- Solution: Open the folder and check the
~/.codex/config.tomlfile to ensure its interface address points to the local routing service (for example, http://127.0.0.1:15721/v1).
2. When integrating MiniMax, the upstream interface reports a 404 error?
- Cause investigation: If you're using the built-in MiniMax preset, please confirm that the current provider is indeed an official preset and that Codex local routing has been successfully enabled.
- Solution: If you're using "Custom Provider" mode, check the Base URL. It should be the root address of the API service, and should not include full interface path suffixes such as
/chat/completions.
3. After typing the /model command in Codex, I can't see the MiniMax model?
- Solution: After saving the provider configuration in CC Switch, you must restart the Codex process. Although CC Switch automatically generates
cc-switch-model-catalog.jsonand writes it to the path, a running Codex does not support hot-reloading the model catalog — you must start a new process to refresh it.
4. Local routing is already enabled, but API requests are still being sent to the old provider?
- Solution: Please verify that the following three states are consistent:
- Under the Codex tab, the currently selected provider is MiniMax.
- The "Local Routing Service" in CC Switch settings shows a running status.
- In the "Routing Enabled" settings, the dedicated switch for Codex is turned on.
5. Can I use the official OpenAI Codex account through local routing?
- Advice: Not recommended. In local routing takeover mode, CC Switch blocks switching to the official OpenAI provider. This is because accessing the official native API through a local proxy or routing may trigger risk control and jeopardize your account. CC Switch's routing feature is mainly designed for third-party large models, aggregated APIs, or scenarios requiring protocol conversion (such as MiniMax).