Agent guide · rapid-mlx 0.12.18 · ← 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.

TIER-1 AGENT   Wire: /v1/responses · Setup: rapid-mlx agents codex --setup · Matrix cell: ✅ ✅ ✅ ✅ (Qwen 3.6 / Gemma 4 / DeepSeek / gpt-oss on 2026-07-07 pilot).
Re-verified 2026-08-01 — a /v1/responses wire smoke, on rapid-mlx 0.11.5, Qwen 3.5-9B-4bit on an M2 Pro Mac mini (32 GB) — Qwen family only; the other three families were not re-run in this pass.

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 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" on rapid-mlx 0.11.5, Qwen 3.5-9B-4bit on an M2 Pro Mac mini (32 GB) — Qwen family only; the other three families were not re-run in this pass. base_url must include the trailing /v1.

Run

$ rapid-mlx serve qwen3.6-35b-4bit
# 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