Setup guide
Guide MINIMAX CODEX
A short, prompt-driven setup for adding the MiniMax model family to the OpenAI Codex desktop app – works on Mac and Windows. No long code dumps. Paste the prompts into Codex and follow the steps.
SHORT SETUP GUIDE · WINDOWS & MACOS
Run MiniMax Models Inside Codex
A short, prompt-driven setup for adding the MiniMax model family to the OpenAI Codex desktop app – works on Mac and Windows. No long code dumps. Paste the prompts into Codex and follow the steps. Time About 15 minutes end to end. Outcome Eight MiniMax models available, automatic routing, one-click switcher. Audience Anyone comfortable opening a terminal or PowerShell. The terminal steps are minimal.
What you get Eight MiniMax models wired into Codex – M3, M2.7, M2.5, M2.1, M2 and their high-speed variants.
Codex's own models (gpt-5.5, gpt-5.4) still available for planning and risky work.
A system prompt that picks the right model per task automatically. One-click switching via a small floating chip (macOS) or a tray menu (Windows). Hard guardrails that block the model from touching .env , secrets, or system files. What you need OpenAI Codex desktop app installed. A MiniMax Token Plan key (starts with sk-cp- ) – get one at https://api.minimax.io . macOS 13+ or Windows 11. About 15 minutes.
Open Codex and tell it what you want
Give Codex the master prompt
Open Codex desktop. In the chat box, paste this prompt and press Enter. Codex will do the rest of the setup for you, asking for your API key and other inputs as it goes. I want to add the MiniMax model family to this Codex install so I can pick from 8 MiniMax models alongside the default gpt-5.x models. Walk me through the setup end to end.
What I need from you
- Ask me for my MiniMax API key (Token Plan, starts with sk-cp-). When I give it, store it in
the macOS keychain (security add-generic-password) on Mac, or in Windows Credential Manager (cmdkey /generic) on Windows.
- Create a model catalog file at ~/.codex/minimax-catalog.json (or
%USERPROFILE%\.codex\minimax-catalog.json on Windows) with 8 MiniMax entries cloned from the
bundled gpt-5.5 template. Slugs: MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-
M2.5, MiniMax-M2.5-highspeed, MiniMax-M2.1, MiniMax-M2.1-highspeed, MiniMax-M2. Each entry
needs slug, display_name, context_window=272000, input_modalities=["text","image"], supports_parallel_tool_calls=true, default_reasoning_level, and supported_reasoning_levels (low/medium/high/xhigh where applicable).
- Configure ~/.codex/config.toml with:
- model = "MiniMax-M3"
- model_provider = "minimax"
- model_catalog_json pointing at the catalog file
- [model_providers.minimax] base_url = "https://api.minimax.io/v1", wire_api = "responses"
- [model_providers.minimax.auth] using the keychain / credential manager lookup
- Create ~/.codex/AGENTS.md with model routing rules: gpt-5.5 for planning/security, MiniMax-
M3 for multi-file work, MiniMax-M2.7 for tests/explanations, MiniMax-M2.5 for routine, MiniMax-M2.1 for small edits, MiniMax-M2 for throwaway. Plus hard guardrails (no .env, no secrets, no rm -rf, always run tests after a refactor).
- Verify by asking me "what model are you on?" and confirming the answer is MiniMax-M3.
Do not overwrite the existing gpt-5.x model_provider block. I want both families available. Show me every file you create or modify before writing it. TIP On Mac, Codex can run the security add-generic-password shell command directly. On Windows, use cmdkey /generic:minimax-api /user:minimax for the keychain equivalent.
Restart and verify
Restart Codex, then test
Quit Codex fully and reopen it. Then paste this short prompt to verify the model is wired correctly. Reply with two things: (1) the slug of the model you are currently running on, and (2) the contents of the model = "…" line in ~/.codex/config.toml. No commentary, just the two values. You should see MiniMax-M3 and a config line that reads model = "MiniMax-M3" . If you do, the routing works.
Add the routing prompt to your projects
Tell Codex when to use which model
Paste this prompt in any new Codex chat. It will create a project-level AGENTS.md (or update it) with the routing rules so every future task in this project picks the right model automatically. Create (or append to) AGENTS.md in the current working directory with these model routing
rules
# Model routing rules
You have two model families in this Codex install. **Codex-native (planning, risky, judgment):**
- gpt-5.5 – architecture, security review, ambiguous product requests
- gpt-5.4 – most planning
**MiniMax (execution):**
- MiniMax-M3 – multi-file refactor, full repo in context (272K tokens)
- MiniMax-M2.7 / M2.7-highspeed – code explanation, repo scan, bounded test gen
- MiniMax-M2.5 / M2.5-highspeed – routine code change
- MiniMax-M2.1 / M2.1-highspeed – lint, type, small edit
- MiniMax-M2 – throwaway, exploratory
# Routing table
| Task | Model |
|———————————–|——————-| | Architecture, planning, security | gpt-5.5 |
| Multi-file refactor | MiniMax-M3 |
| Code explanation, repo scan | MiniMax-M2.7 |
| Bounded test generation | MiniMax-M2.7 |
| Routine code change | MiniMax-M2.5 |
| Lint / type / small edit | MiniMax-M2.1 |
| Throwaway / exploratory | MiniMax-M2 |
| Auth, payment, secrets, prod ops | gpt-5.5 (no delegate) |
# Hard guardrails
- Never touch .env, secrets/, *.pem, *.key, id_rsa*
- Always run the project's test suite after a non-trivial refactor
- Never run rm -rf outside the project working directory
- Never modify /etc, /usr, ~/Library, C:\Windows, or C:\Program Files without asking
- If a task is ambiguous, ask one clarifying question, then proceed
# Switching
To switch mid-session, the user clicks the floating chip (Mac) or tray menu (Windows), or types "switch to MiniMax-M3" / "use gpt-5.5 for this" in chat.
Add the one-click switcher
Floating chip (macOS) or tray menu (Windows)
Codex's built-in model dropdown has a known bug that hides custom models. The fix is a small companion
app that switches the default model with one click. Pick your platform and paste this prompt into Codex.
macOS – floating chip
Build a small macOS app at /Applications/minimax-floater.app that shows a floating chip at the top-right of the screen when com.openai.codex is the front app. The chip is an NSPopUpButton with all 8 MiniMax models. Clicking a model rewrites ~/.codex/config.toml via the switcher script at ~/.mavis/skills/codex-minimax-m3/scripts/codex-set-model.sh and restarts Codex. Hide the chip when any app other than Codex is front. Use NSWorkspace.didActivateApplicationNotification to detect the front app. Set activation policy to .regular so the window posts to the WindowServer. Sign with codesign –force –deep –sign -. Provide the Swift source, the Info.plist, and the bash switcher script. Compile with swiftc -O -target arm64-apple-macos13.0. Windows – system tray menu Build a small Windows app at C:\Program Files\minimax-tray\minimax-tray.exe that shows a system tray icon with a right-click menu listing all 8 MiniMax models. Clicking a model rewrites %USERPROFILE%\.codex\config.toml via a PowerShell switcher and restarts Codex. Show the current model in the tray icon tooltip. Auto-start with Windows via a Run registry key under HKCU\Software\Microsoft\Windows\CurrentVersion\Run. Use Python with pystray and PIL, or C# with Windows Forms NotifyIcon. Provide the full source and the PowerShell switcher script.
MACOS
The chip appears in the top-right of the screen, just below the menubar, only when Codex is the active app. Click it, pick a model, Codex restarts in about a second.
WINDOWS
The tray icon sits in the notification area. Right-click for the model menu, left-click to show the current model. Stays out of the way until you need it.
Test it works
End-to-end check
Paste this final prompt in Codex. It walks through a real task and confirms the model actually changes.
I want to verify the model routing works end to end. Please
- Reply with the slug of the model you are currently running on.
- Click the floating chip (Mac) or tray menu (Windows) and switch to MiniMax-M2.5. Wait for
Codex to restart, then reply with the new model slug.
- Open ~/.codex/config.toml and confirm the line "model = \"MiniMax-M2.5\"" exists. Report
what you found.
- Switch back to MiniMax-M3 and confirm the slug you are on now.
If any step fails, tell me exactly which step and what went wrong.
Troubleshooting
Codex is not loading the MiniMax model
Open Codex and paste
Show me the contents of the [model_providers.minimax] block in ~/.codex/config.toml. Then show me the value of model = "…" on the first non-comment line. Then run this exact shell command and show me the output: curl -s -o /dev/null -w "%{http_code}\n" https://api.minimax.io/v1/models -H "Authorization: Bearer $(security find-generic-password -a minimax -s minimax-api -w)" (Mac) or the equivalent cmdkey-based lookup on Windows. Tell me what is wrong. Keychain / credential manager prompt keeps appearing
MACOS
Paste this into Codex to permanently allow the lookup
Run this exact command: security set- key-partition-list -S apple- tool:,apple: -s minimax-api -a minimax. Show me the output.
WINDOWS
Paste this into Codex to add the key to the user
credential store
Run cmdkey /generic:minimax-api
/user:minimax and then test the lookup
with: powershell -Command "cmdkey
/list:minimax-api". Show me both
outputs. Floating chip (Mac) or tray icon (Windows) not appearing Check whether the floating chip process is running (Mac: pgrep -lf minimax-floater; Windows: Get-Process minimax-tray -ErrorAction SilentlyContinue). If not running, open the .app or .exe again. If running but invisible, restart it and confirm it is allowed to run in System Settings. Tell me what you find.
Codex restart is not picking up the new model
Quit Codex fully (Mac: pkill -f "Codex.app"; Windows: Stop-Process -Name Codex -Force). Wait 2 seconds. Reopen Codex. Ask Codex "what model are you on?" and report the answer.
Permissions you will be asked for When you run this for the first time, your operating system will prompt for these. None of them are scary.
PERMISSION WHY WHERE TO GRANT
Keychain / Credential
Manager
Stores the API key in the OS
password vault so it never sits in a plain text file.
macOS prompts automatically. Windows
Control Panel → Credential Manager →
Windows Credentials.
Background launch (Mac)
/ Startup (Windows)
The shim and the switcher auto- start on login. One-time prompt.
Mac: System Settings → General → Login
Items. Windows: Task Manager → Startup apps.
Gatekeeper (Mac) /
SmartScreen (Windows)
The companion app is unsigned.
First launch will be blocked.
Mac: right-click the app → Open. Windows
click "More info" → "Run anyway".
What is installed
FILE WHAT IT DOES
~/.codex/minimax-catalog.json 8 MiniMax model definitions for Codex
~/.codex/config.toml (updated) Points Codex at the MiniMax provider and the
catalog
~/.codex/AGENTS.md Routing rules that pick the right model per task
Keychain entry (Mac) or Credential Manager entry
(Windows)
Stores the MiniMax API key securely
Floating chip (Mac) or tray icon (Windows) One-click model switcher You now have a two-layer AI dev stack on your machine: Codex's own models for planning, MiniMax M3 and the rest of the family for coding, automatic routing via a system prompt, and a one-click switcher that lives alongside Codex.
Final checklist
- The required app, command, or service opens correctly.
- Credentials are stored outside public files and screenshots.
- A small test run completes before you use the setup for real work.
- You know where logs, output files, and error messages are stored.