Codex

Use MiniMax M3.1 Flash in Codex

A reproducible read/edit/test run, an optional catalog, and the login setting that interrupted our first attempt.

Reviewed China endpoint tested; global endpoint and desktop app remain unverified

What we actually tested

Our testing — 23 October 2026. Codex CLI 0.163.0, Node 22.23.3, Linux, MiniMax-M3.1-Flash, effort low, the official MiniMax capability catalog, and the China endpoint https://api.minimax.cn/v1. On one small invoice task, Codex read the files, changed the function and invoked tests. Our outer harness reran the unchanged test file: five checks passed. The starting implementation failed.

Download the recorded result and diff, test kit, or runner source. This is one integration check, not a model ranking, a large-codebase evaluation or evidence of long-context performance. We did not test the desktop app, the wizard, image inputs or subscription billing.

The available key returned HTTP 401 against the international Responses endpoint. The global configuration below follows the documentation but remains unverified with a matching global key.

Requirements and region

Official. MiniMax recommends Codex CLI 0.146.0 or newer. Our result applies to the version above; it does not test every supported version. A desktop installation is not required for this CLI workflow.

Match the key to the platform: international uses https://api.minimax.io/v1; China uses https://api.minimax.cn/v1. For M Plan, obtain the Subscription Key from Plan Details rather than silently using a pay-as-you-go key. See M Plan.

Option 1: the official wizard

npx -y mmx-cli@latest agent setup

Select Codex. MiniMax documents installation of a missing CLI, configuration of ~/.codex/config.toml and a wizard-managed ~/.codex/mmx-model-catalog.json. Close Codex and editors holding the configuration before the wizard, then restart. This route has not been reproduced by us.

Option 2: a custom provider with an environment key

Back up your existing configuration before merging these entries into ~/.codex/config.toml. Set MINIMAX_API_KEY in your terminal environment; do not paste your real key into a shared configuration or report. A downloadable template is included.

model = "MiniMax-M3.1-Flash"
model_provider = "minimax"
model_context_window = 524288
model_reasoning_effort = "low"

[model_providers.minimax]
name = "MiniMax"
base_url = "https://api.minimax.io/v1"
env_key = "MINIMAX_API_KEY"
wire_api = "responses"

For China, change the base URL to https://api.minimax.cn/v1. This is a custom-provider adaptation using OpenAI’s documented env_key field. MiniMax’s own example instead embeds a key in experimental_bearer_token and includes login-method fields. Our tested runner uses the environment-key variant.

model_context_window=524288 is the client context budget, recommended by MiniMax for everyday multi-turn work. It is not derived from the model’s output ceiling. We have not tested near this limit. wire_api="responses" chooses the protocol used by Codex; a provider offering only Chat Completions is not sufficient evidence of Codex compatibility.

A login setting that failed in our first attempt

Our testing. With an existing ChatGPT login, copying forced_login_method="api" caused Codex to exit with:

API key login is required, but ChatGPT is currently being used. Logging out.

That attempt did not reach the coding task. Removing the forced-login setting and selecting the custom provider with env_key allowed the subsequent run to complete. The final reproduction runner also sets cli_auth_credentials_store="ephemeral" for the test process. Do not assume --ignore-user-config alone isolates authentication storage; existing sign-in state may still be read. If a previous attempt logged you out, sign in again for your usual ChatGPT workflow.

The model catalog is optional, and must be loaded explicitly

Official. MiniMax describes the manual capability catalog as optional. It supplies the model picker entry and supported reasoning levels; it is not a prerequisite for every request. Merely writing a JSON file does not load it.

Download the catalog snapshot, save it locally, and add this top-level setting before any TOML table headers:

model_catalog_json = "/absolute/path/to/model-catalog.json"

Use the actual absolute path. The wizard’s filename and the manual guide’s custom-catalog.json are different conventions; the setting must point to the file you actually have. Restart after changes. Our test used the downloaded catalog.

MiniMax’s catalog declares supports_reasoning_summaries=true so Codex sends reasoning effort, with default_reasoning_summary="none" to avoid requesting a separate summary. A summary of none is different from reasoning effort none: MiniMax explicitly warns that effort none is unsupported and returns 400. The supported efforts are low, medium, high, xhigh and max; this test selected low.

Reproduce the coding task

Extract the kit, supply MINIMAX_API_KEY in the environment, then run:

python3 run.py codex --region global --output /tmp/codex-result.json

Use --region cn for China. The runner creates a temporary task directory, ignores user configuration and rules, uses ephemeral credential storage, and runs Codex with the workspace-write sandbox. It supplies command-line provider settings instead of editing your normal config. Requests consume real provider usage.

The fixture checks mixed quantities, empty and zero-quantity invoices, invalid quantities and input immutability. The harness independently reruns the test file, checks that the agent did not alter it and saves the diff. Review baseline_exit, verification_exit and tests_unchanged alongside the tool transcript.

Our Codex transcript contains both node --test invoice.test.cjs and a direct node invoice.test.cjs run. The latter displays all five individual checks; the outer harness separately confirmed the result. Do not mistake the transcript’s one-file summary for a one-assertion test.

Troubleshooting

SymptomEvidence and next step
401 invalid api keyOur testing: the available key failed on .io; the China route completed. Check key, region and entitlement before changing unrelated settings.
Forced API login logs out ChatGPTOur testing: omit the forced-login setting for this custom-provider variant; use the isolated runner and inspect the actual error.
Provider not recognisedMake model_provider match [model_providers.minimax].
Model missing from pickerOfficial: load the optional catalog with top-level model_catalog_json, then restart.
reasoning.effort rejectedOfficial: do not use none; check supported levels in the current catalog.
Configuration revertsOfficial: close other Codex processes and editors before modifying the file.

We do not infer real dollar charges from token counts or CLI cost estimates. Provider billing and the pricing page are separate evidence. No latency, throughput or success-rate claim follows from one completed task.

Next: compare the same fixture in Claude Code, consult the API guide for protocol details, or use the FAQ for region and configuration errors.

Sources and version notes

Checked October 23, 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