Skip to main content
Codex CLI is OpenAI’s open-source agentic coding assistant that runs in your terminal. It can read files, write code, run commands, and iterate on its work using the Responses API.
Requires Responses API - Codex CLI uses the /v1/responses endpoint which Infercom supports with MiniMax-M2.7.
Known limitation: Tool-using (agentic) sessions via the Responses API are currently affected by a server-side streaming issue and may return empty responses for tool calls. For reliable agentic coding today, use OpenCode, Cline, or Aider, which run over the Chat Completions API. This page will be updated when resolved.

Prerequisites

Installation

Verify installation:
macOS users: If macOS blocks the binary as “malware”, go to System Preferences > Security & Privacy and click “Allow Anyway”, or run:

Configuration

Codex CLI supports custom providers via a TOML configuration file.

Step 1: Set Environment Variable

Add this to your shell profile (~/.bashrc, ~/.zshrc) for persistence.

Step 2: Create Config File

Create ~/.codex/config.toml:
For complex tasks requiring deeper reasoning, Codex CLI supports profiles with different models. You can use a frontier model (Claude, GPT, Gemini) for planning and MiniMax-M2.7 for execution. See Codex documentation for profile configuration.

Step 3: Verify Setup

Run Codex in any project directory:
You should see Codex start with:

Model

Use MiniMax-M2.7 - optimized for agentic coding with 192K context and built-in reasoning.

Usage

Interactive Mode

Start Codex in your project directory:
Type your request and Codex will:
  • Read relevant files
  • Write or edit code
  • Run terminal commands
  • Iterate until the task is complete

Example Tasks

  • “Add error handling to the login function”
  • “Write unit tests for the User class”
  • “Refactor this file to use async/await”
  • “Find and fix the bug causing the test to fail”

Non-Interactive Mode

For scripted or one-shot use, use the exec subcommand:

Configuration Options

Full ~/.codex/config.toml reference:

Approval Modes

Troubleshooting

Connection Errors

Verify your configuration:
Expected output: "completed"

Model Not Found

Ensure the model name is exact (case-sensitive): MiniMax-M2.7

Slow Responses

MiniMax-M2.7 runs at 400+ tokens/sec. If responses seem slow:
  1. Check your network connection
  2. Large context (many files) increases processing time
  3. First request may be slower due to model loading

Why Codex CLI with Infercom?

Next Steps

  • Aider - Alternative terminal-based tool
  • OpenCode - Modern TUI with similar features
  • Responses API - API documentation for custom integrations