Adapter required. Current Codex uses the Responses API; pointing it directly at NoMask or setting
wire_api = "chat" does not work. Adapter compatibility depends on your Codex version and selected model.Before you start
- Create a key on the API Keys page and add funds to your API balance.
- Choose a text model with Function calling and streaming on the Models page. Copy its exact model ID.
- Use the connection values below. Replace key placeholders locally; keep secrets out of project files and source control.
Replace
your-model-id throughout the examples with the exact ID of a text model that supports function calling and streaming. Check the Models page for current availability and limits.Install and configure
1. Start a local protocol adapter
Install Python 3.11 or newer. In a dedicated terminal, install the current LiteLLM proxy package:- macOS / Linux / WSL
- Windows PowerShell
nomask-adapter.yaml. The local alias nomask routes to your-model-id; changing models means updating this route and restarting the adapter.
custom_openai/ makes LiteLLM translate requests into Chat Completions. Do not enable native Responses or Messages passthrough: NoMask does not expose those protocols. Unsupported optional fields may be removed by drop_params.
store_prompts_in_spend_logs off. NoMask’s prompt-storage policy is unchanged.
2. Install Codex
Install Node.js, then open a second terminal:3. Configure the CLI
Merge the following into~/.codex/config.toml on macOS/Linux or %USERPROFILE%\.codex\config.toml on Windows. Keep the top-level settings before the first table and avoid duplicate keys.
NOMASK_GATEWAY_KEY in the adapter terminal. This is separate from your NoMask API key.
- macOS / Linux / WSL
- Windows PowerShell
nomask alias may use generic Codex model settings. For a managed deployment, supply a version-matched Codex model catalog with the same alias and actual capabilities using model_catalog_json. NoMask’s model-list JSON uses a different schema and cannot be used as that file. Follow the official catalog specification linked below.
Launch and test
With the adapter running, open a disposable project folder and runcodex. Use /status to confirm the local connection and nomask alias.
Stop using this setup if tool results, custom tools or conversation continuation fail. An adapter cannot add missing model capabilities. Cline, Kilo Code, Command Code, OpenCode and Aider have direct Chat Completions setup guides in this section.
/responses 404, make sure Codex points to the local adapter, and the adapter route uses custom_openai/. If ordinary NoMask calls also fail, check the key and model independently:
Troubleshooting
- 401: check that your key is active and available to the process running the tool. Restart the tool after changing environment variables.
- 402: add funds to your API balance or reduce the requested output.
- 404: check the exact model ID and base URL. Direct connections use Chat Completions, not Responses or Anthropic Messages.
- 429: wait for
Retry-After. API keys share account limits; creating another key does not reset usage. Check the key’s monthly spending cap too. - Context or tool errors: start a shorter task, lower the output limit and confirm the model supports function calling. A plain text reply alone does not confirm file-editing tools work.
Official references
Setup checked against the documentation below. Tool versions may change their settings or configuration format.- Codex model compatibility
- Codex custom connections and configuration
- Codex gateway compatibility requirements
- Codex model catalog specification
- LiteLLM Responses translation and native passthrough
- LiteLLM Codex setup and model metadata
- LiteLLM 1.101.6 Codex tool-call fixes
- LiteLLM local server configuration