Agent guide · rapid-mlx 0.10.3 · ← Back to README

Codex CLI

OpenAI Codex CLI (Rust, 0.136.0+) is the official OpenAI agent CLI. It speaks /v1/responses — the "responses" API, not the chat-completions one. rapid-mlx exposes /v1/responses as a first-class route so Codex talks to your local server the same way it talks to api.openai.com.

Wire: /v1/responses · Setup: rapid-mlx agents codex --setup · Matrix cell: ✅ ✅ ✅ ✅ (Qwen 3.6 / Gemma 4 / DeepSeek / gpt-oss on 2026-07-07 pilot).

Install

Homebrew or npm — Codex CLI is upstream OpenAI, install the vendor binary:

$ brew install codex
# or
$ npm install -g @openai/codex

Config

The one-shot: rapid-mlx agents codex --setup writes ~/.codex/config.toml for you. By hand, the exact block rapid-mlx 0.10.3 emits is:

# ~/.codex/config.toml
model = "default"
model_provider = "rapid-mlx"

[model_providers.rapid-mlx]
name = "Rapid-MLX (local)"
base_url = "http://localhost:8000/v1"
# No auth field — rapid-mlx is unauthed by default and Codex
# --strict-config rejects an inline literal like `api_key = "..."`.
# If you start the server with --api-key, add:
#     env_key = "RAPID_MLX_API_KEY"
# and `export RAPID_MLX_API_KEY=<your-key>` in your shell.

The [model_providers.rapid-mlx] block is what Codex resolves after reading model_provider = "rapid-mlx". base_url must include the trailing /v1.

Run

$ rapid-mlx serve qwen3.6-35b-4bit \
    --tool-call-parser qwen3_coder_xml --enable-auto-tool-choice
# in another shell:
$ codex
# or one-shot exec:
$ codex exec "read main.py and summarize what it does"

Recommended aliases (per rapid-mlx agents codex): qwen3.6-35b-4bit, qwen3.5-9b-4bit, qwen3-coder-30b-4bit.

Gotchas

Empirical

The codex-cli row of the integration matrix is ✅ across all four Tier-1 families (Qwen 3.6, Gemma 4, DeepSeek R1-Distill, gpt-oss) on the 2026-07-07 pilot. The matrix cell posts a minimal /v1/responses envelope, verifies the SSE-shaped output body is non-empty, and asserts no <think> or <|channel|>analysis leak in the emitted text. Source of truth for this page: tests/integrations/test_agents_matrix.py::TestCodexCLI and the CLI output of rapid-mlx agents codex.

See also