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.

Reviewed Not independently reproduced by us

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 setup

Select 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:

FieldWhy it matters
model_provider = "minimax"Points Codex at the provider block below
model_context_window = 524288The 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_methodForce API-key usage instead of an interactive login
base_urlThe 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

  1. Close every Codex process and any editor with the config file open.
  2. Start Codex again.
  3. Confirm the selected model is the MiniMax entry and send a short prompt.
  4. Check that a long input is not truncated or refused.

Troubleshooting

SymptomCauseFix
Provider not recognisedmodel_provider does not match the table nameBoth must be minimax
Model missing from the pickerCatalog file absentRun the wizard, or write ~/.codex/mmx-model-catalog.json
Config reverted after editingAnother process saved a stale copyClose Codex and editors holding the file, then edit again
Context window not appliedmodel_context_window unset or too smallSet 524288
Authentication prompts instead of using the keyLogin method not forcedSet preferred_auth_method and forced_login_method
Requests rejected on large inputsWindow misconfiguredConfirm 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.

Spotted something out of date? Suggest a correction →

Your next step