A complete solution to connect OpenAI Codex CLI and Codex Desktop with Xiaomi MiMo API.
OpenAI's Codex CLI is a powerful terminal-based AI coding assistant, but it uses the Responses API (/v1/responses), while Xiaomi MiMo only supports the standard Chat Completions API (/v1/chat/completions).
These are two completely different protocol formats and cannot be solved by simply changing the URL.
| Codex Version | wire_api Support | MiMo Compatible | Notes |
|---|---|---|---|
| v0.80.0 | chat |
✅ Direct | Legacy, limited features |
| v0.137.0+ | responses |
❌ Needs proxy | Latest, supports Desktop |
Although v0.80.0 can directly use wire_api = "chat" with MiMo:
- Codex Desktop only supports the latest CLI version
- v0.80.0 doesn't support new
app-serverAPI methods - Legacy versions will be phased out
Use codeproxy as a local proxy to convert Responses API requests to Chat Completions API requests in real-time.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Codex CLI │────▶│ codeproxy │────▶│ Xiaomi MiMo │
│ Codex Desktop │ │ localhost:8787 │ │ API │
│ │ │ │ │ │
│ Responses API │ │ Protocol │ │ Chat Comp. API │
│ /v1/responses │ │ Conversion │ │ /v1/chat/... │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Benefits:
- ✅ Supports latest Codex CLI (v0.137.0+)
- ✅ Supports Codex Desktop GUI
- ✅ Protocol conversion happens locally (no third-party servers)
- ✅ One-time setup, permanent use
- Ubuntu 22.04 (other Linux distros also work)
- Node.js 18+
- npm
- Xiaomi MiMo API Key and Base URL
git clone https://github.com/linksdeact-sys/codex-mimo-setup.git
cd codex-mimo-setup
# Replace with your API Key and Base URL
bash scripts/04-setup-codex-mimo.sh YOUR_API_KEY YOUR_BASE_URLThe script will automatically:
- Install latest Codex CLI
- Install codeproxy
- Create config file
~/.codex/config.toml - Set environment variables
- Create launcher scripts
Option 1: Terminal
~/bin/codex-launcherOption 2: Application Menu Search for Codex (MiMo) in the app menu and click the icon.
Option 3: Direct CLI Usage
# Ensure proxy is running
~/bin/start-codex-mimo
# Use Codex
codex # Interactive mode
codex exec "your prompt" # Non-interactive mode- Codex + MiMo Complete Guide — Step-by-step manual configuration
- Troubleshooting — Common issues and solutions
npm install -g @openai/codexnpm install -g @codeproxy/clicodeproxy \
--base-url "YOUR_BASE_URL/v1/chat/completions" \
--apikey "YOUR_API_KEY" \
--model "mimo-v2.5-pro" \
-p 8787Create ~/.codex/config.toml:
model = "mimo-v2.5-pro"
model_provider = "mimo"
[model_providers.mimo]
name = "Xiaomi MiMo"
base_url = "http://127.0.0.1:8787/v1"
env_key = "MIMO_API_KEY"
wire_api = "responses"Add to ~/.bashrc:
export MIMO_API_KEY="YOUR_API_KEY"codex exec "introduce yourself in one sentence"git clone https://github.com/ilysenko/codex-desktop-linux.git
cd codex-desktop-linux
make bootstrap-native# Ensure proxy is running
~/bin/start-codex-mimo
# Start Desktop
export CODEX_CLI_PATH=$(which codex)
export MIMO_API_KEY="YOUR_API_KEY"
cd ~/codex-desktop-linux/codex-app && bash start.shcodex-mimo-setup/
├── README.md # English documentation
├── README_CN.md # 中文文档
├── LICENSE # MIT License
├── config/
│ ├── codex-config.toml # Codex config template
│ └── codex.desktop # Desktop shortcut config
├── docs/
│ ├── codex-mimo-guide.md # Complete setup guide
│ └── troubleshooting.md # Common issues
└── scripts/
├── 04-setup-codex-mimo.sh # One-click install script
└── codex-launcher # Desktop launcher
- OpenAI Codex CLI — Codex command-line tool
- codeproxy — Responses API to Chat Completions API proxy
- Xiaomi MiMo — AI model service
- codex-desktop-linux — Codex Desktop Linux port
MIT License