Codex
Use MiniMax M3.1 Flash in Codex
A provider block in config.toml, one extra catalog file, and a version floor that has bitten people.
Requirements
- Codex CLI 0.146.0 or newer. The MiniMax documentation recommends that version and above.
- The Codex desktop app, if you use the desktop client rather than the CLI.
- A MiniMax API key from the developer platform.
Option 1: the setup wizard
npx -y mmx-cli@latest agent setupSelect Codex. The wizard offers to install @openai/codex if the codex command is missing, then writes ~/.codex/config.toml and ~/.codex/mmx-model-catalog.json.
One operational rule the documentation is explicit about: close Codex and any editor that has ~/.codex/config.toml open before running the wizard. If another process still holds the file, it can save stale contents over the configuration the wizard just wrote.
Option 2: manual config.toml
Add or update these entries in ~/.codex/config.toml:
model = "MiniMax-M3.1-Flash"
model_provider = "minimax"
model_context_window = 524288
preferred_auth_method = "apikey"
forced_login_method = "api"
[model_providers.minimax]
name = "MiniMax"
base_url = "https://api.minimax.io/v1"
experimental_bearer_token = "<MINIMAX_API_KEY>"
wire_api = "responses"Field by field:
| Field | Why it matters |
|---|---|
model_provider = "minimax" | Points Codex at the provider block below |
model_context_window = 524288 | The harness’ notion of the usable window. Set it to the output ceiling; the model itself accepts a 1M-token input window |
preferred_auth_method / forced_login_method | Force API-key usage instead of an interactive login |
base_url | The OpenAI-compatible path, /v1 — not the Anthropic-compatible one |
wire_api = "responses" | Selects the Responses API shape Codex expects from this provider |
The mmx-model-catalog.json file
The wizard also writes ~/.codex/mmx-model-catalog.json. It is the model list Codex shows when you pick a model, so the MiniMax entries (including the long-context variant) appear in the picker.
If you configure Codex entirely by hand and the model does not show up in the selection UI, that catalog file is the missing piece — the config alone points Codex at the provider, but the catalog is what lists the model.
Restart and verify
- Close every Codex process and any editor with the config file open.
- Start Codex again.
- Confirm the selected model is the MiniMax entry and send a short prompt.
- Check that a long input is not truncated or refused.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Provider not recognised | model_provider does not match the table name | Both must be minimax |
| Model missing from the picker | Catalog file absent | Run the wizard, or write ~/.codex/mmx-model-catalog.json |
| Config reverted after editing | Another process saved a stale copy | Close Codex and editors holding the file, then edit again |
| Context window not applied | model_context_window unset or too small | Set 524288 |
| Authentication prompts instead of using the key | Login method not forced | Set preferred_auth_method and forced_login_method |
| Requests rejected on large inputs | Window misconfigured | Confirm both the catalog entry and the context value |
Cost note
Codex sessions are long-horizon: many turns, large diffs, and reasoning that is always on. The pricing page shows how the reasoning budget and prompt caching interact, and why the default max effort is the first thing to check.
Next: Cursor setup, the API reference for the endpoint details, or the FAQ.
Sources and version notes
Checked October 21, 2026. We label official claims, third-party measurements, our own testing and community reports separately — see the sources policy for what each label means.