Codex Configuration
Pay-as-you-go MiMo API and Token Plan both support Codex. Refer to this guide for configuration and usage.
Prerequisites
Obtain Credentials
Two usage methods are supported, but the corresponding credential acquisition methods differ:
| Usage Method | Description | Acquisition Method (BASE_URL and API Key below are examples) |
|---|---|---|
| Pay-as-you-go API | Charged based on actual usage, suitable for light use |
Go to API Keys to create an API Key |
| Token Plan | Fixed subscription fee, with limited calls based on the package |
After successful subscription, go to Token Plan to obtain the exclusive Base URL and API Key |
Install Codex
Prerequisites: Node.js 18 or a later version must be installed first.
Installation command:
npm install -g @openai/codex
Verify the installation (a version number output indicates success):
codex --version
Edit Configuration File
Notes
- When configuring basic information, first check if the
MIMO_API_KEYenvironment variable exists. If it does, please clear it or replace the value with the API Key obtained through the corresponding usage method.
Configuration file paths:
-
macOS/Linux:
-
config.toml:~/.codex/config.toml -
model-catalogs.json:~/.codex/model-catalogs.json
-
-
Windows
-
config.toml:User directory\.codex\config.toml -
model-catalogs.json:User directory\.codex\model-catalogs.json
-
Below is a complete configuration example. The model field can be modified to other supported models as needed (e. g., mimo-v2.6-pro). For the model_catalog_json configuration, please refer to the path of the system configuration file you are using. The file download address is: model-catalogs.json.
Pay-as-you-go
Edit or create the configuration file config.toml
# Configure model metadata
model_catalog_json = "~/.codex/model-catalogs.json"
model = "mimo-v2.6-pro"
model_provider = "mimo"
model_reasoning_effort = "high"
# Enable model reasoning summaries; if set to false, model_reasoning_effort will not take effect even if configured
model_supports_reasoning_summaries = true
model_reasoning_summary = "none"
model_context_window = 1048576
web_search = "disabled"
[model_providers.mimo]
name = "mimo"
base_url = "https://api.xiaomimimo.com/v1"
experimental_bearer_token = "sk-your-api-key-here"
wire_api = "responses"
Token Plan
Edit or create the configuration file config.toml
# Configure model metadata
model_catalog_json = "~/.codex/model-catalogs.json"
model = "mimo-v2.6-pro"
model_provider = "mimo"
model_reasoning_effort = "high"
# Enable model reasoning summaries; if set to false, model_reasoning_effort will not take effect even if configured
model_supports_reasoning_summaries = true
model_reasoning_summary = "none"
model_context_window = 1048576
web_search = "disabled"
[model_providers.mimo]
name = "mimo"
base_url = "https://token-plan-cn.xiaomimimo.com/v1"
experimental_bearer_token = "tp-your-api-key-here"
wire_api = "responses"
Use Codex CLI
After completing the above configuration, open a new terminal and run the following command to start Codex.
codex
After configuring the model source data file, you can switch models via the /model command in Codex.
Use Codex IDE Plugin
Codex provides a VS Code plugin. Search for "Codex" in the VS Code Extension Marketplace to install it. The plugin automatically reuses the existing local Codex configuration. If you have never used the Codex command-line tool, please follow the specifications in the "Edit Configuration File" section to complete the configuration.
Use Codex Desktop
The Codex desktop client will reuse the existing configurations in your local Codex. Please refer to the "Editing Configuration File" section to complete the configuration before use.
FAQ
Codex throws an error saying "custom tools require MiMo freeform Responses lite mode."?
The custom tool is not supported for use in non-lite mode. If you encounter this error, please configure the model metadata file model-catalogs.json in accordance with the "Edit Configuration File" section, and then restart Codex.