To facilitate integrating models with the Codex CLI, it is recommended to use the
codex-MiniMax-M2.1 model. While models can interact with files using tools like Bash, this approach is not considered optimal for Agent workflows. For better Agent-based practices, we suggest using platforms such as Claude Code or Cursor.Install Codex CLI
Usenpm to install the Codex CLI globally:
Configure MiniMax API
- Add the following configuration to the
.codex/config.tomlfile.
- The
base_urlshould be set based on your location: for international users, usehttps://api.minimax.io/v1; for users in China, usehttps://api.minimaxi.com/v1
- Set the API key using environment variables in the current terminal session for security reasons. Use the API key obtained from the MiniMax Developer Platform (For users in China, visit MiniMax Developer Platform) as the value for
MINIMAX_API_KEY.
- Start the Codex CLI with the specified profile.