Skip to main content
Connect Codex to CMX so every request from Codex passes through the local gateway. CMX compresses repeated context in the background, reducing the tokens sent to your model provider on each turn — without changing how you use Codex.
Prerequisites: CMX must be installed and signed in on your device. Codex must already be installed with a working model provider sign-in. CMX does not replace your provider account; you continue signing in through Codex as usual.
1

Set Up CMX

Run the guided setup command to sign in, start the local gateway, and detect your coding agents:
Follow the browser sign-in prompt. Once setup completes, the CMX gateway starts at 127.0.0.1:17322 and is ready to accept connections.
2

Connect Codex

Open the CMX terminal UI and connect Codex to your provider:
  1. Navigate to CONFIG → Codex.
  2. Select your connection from the list.
  3. Click Connect.
  4. Restart Codex so it picks up the new routing through CMX.
Codex will now send all requests through the CMX gateway instead of directly to your provider.
3

Verify the Connection

Confirm that Codex is routing through CMX correctly:
Send a request from Codex as you normally would in a coding session. Then check CMX for activity:
New requests should appear in the stats output. If you see activity, the connection is working.
Short conversations may show little or no compression. Savings grow with longer sessions as eligible older context accumulates. Compare stats across a full coding session to get a representative picture.

Troubleshooting

If requests from Codex are not appearing in cmx stats after a coding session:
  1. Restart Codex — the new routing only takes effect after a full restart.
  2. Check the selected connection — open CONFIG → Codex in CMX and confirm the correct provider is connected.
  3. Run the diagnostics command:
For more detailed guidance, see the troubleshooting guide. If the issue persists, contact support with your CMX version, OS, and a description of what happened. Looking for a different integration? See Connect Any OpenAI or Anthropic Agent to CMX if your tool is not Codex or OpenCode.