Codex App desktop configuration
Connect the macOS or Windows Codex desktop app to AIMirrorX with config.toml, an API key environment variable and model catalog guidance.
Connecting the desktop app
The Codex desktop app reads model gateway settings from local config.toml. On macOS it shares the default user configuration with the local CLI. Fully quit and restart the app after editing it. The Windows app uses the Windows user directory, not the WSL configuration.
For terminal usage, see Codex CLI configuration. The official gateway guide documents the macOS and Windows app configuration.
1. Prepare a key and model
Create a key in the AIMirrorX console. The model and channel must support Responses, streaming and tool calls.
Use an original model name recognized by your Codex version and routed to the matching model by the gateway. Custom aliases require matching Codex model metadata from your administrator. No particular model is guaranteed to be available on your account.
2. Edit config.toml
| Platform | Default user configuration |
|---|---|
| macOS | ~/.codex/config.toml |
| Windows | %USERPROFILE%\.codex\config.toml |
If the app launch environment sets CODEX_HOME, use config.toml there. Merge these fields into existing settings without duplicating keys or tables. Keep the first three top-level settings before TOML table headers.
model = "YOUR_RESPONSES_MODEL_ID"
model_provider = "aimirrorx"
web_search = "disabled"
[model_providers.aimirrorx]
name = "AIMirrorX"
base_url = "https://api.aimirrorx.com/v1"
env_key = "AIMIRRORX_API_KEY"
wire_api = "responses"
requires_openai_auth = falseReplace YOUR_RESPONSES_MODEL_ID with your actual model ID. End base_url with /v1, without /responses. env_key names the environment variable, not the secret itself. Built-in web search is disabled for the initial test; verify gateway support before enabling it.
This setup uses the AIMirrorX API key with requires_openai_auth = false. It does not require manually editing auth.json.
3. Make the key available to the app
An app launched from the desktop may not inherit a terminal's export. Supply AIMIRRORX_API_KEY to the process that actually launches the app.
macOS
Fully quit Codex, then set the variable for your current user login session in Terminal and reopen the app from the desktop:
launchctl setenv AIMIRRORX_API_KEY "YOUR_AIMIRRORX_API_KEY"Replace the key placeholder. Set it again after logout or restart. If a managed launcher or secret delivery tool already supplies the variable, use that method. Keep real keys out of projects, screenshots and Git.
Windows
Fully quit Codex. In PowerShell, set a user environment variable:
[Environment]::SetEnvironmentVariable(
"AIMIRRORX_API_KEY",
"YOUR_AIMIRRORX_API_KEY",
"User"
)You can also create the same user variable in Windows Environment Variables settings. Replace the placeholder, sign out of Windows and sign back in, then open the app so the desktop launch process receives the variable. Closing a chat window alone does not fully quit the app. This user variable persists.
The Windows app uses Windows files and variables. A CLI running inside WSL uses the WSL environment instead.
4. Restart and verify
- Fully quit and reopen the app.
- Open a local project and start a new chat. Check the
aimirrorxprovider and the configured model ID. - Try a simple project summary request before development work.
- If settings remain unchanged, check trusted project
.codex/config.toml, profiles and managed settings for overrides.
This provider controls model requests. MCP, plugins, voice and other connected capabilities have separate network paths, authentication or permissions. An AIMirrorX key does not authorize those systems. These instructions do not change approval or sandbox settings.
Model catalogs
- For a built-in model name, ensure the bundled metadata matches the model actually routed by the gateway.
- A custom alias needs Codex-compatible model metadata. An ordinary
GET /v1/modelsresponse listing IDs alone is insufficient. - If your administrator provides a real catalog URL, add
model_catalog_urlinside the provider table. For a local file, use top-levelmodel_catalog_jsonwith its existing absolute path. - Do not invent catalog URLs or file paths. An effective
model_catalog_jsontakes precedence over a remote catalog.
Troubleshooting
| Symptom | What to check |
|---|---|
| CLI works but the app reports a missing key | Check the app launch environment; reset the macOS session variable or sign out and back in on Windows |
| Another provider remains active | Check config location, CODEX_HOME, project overrides and a full app restart |
| 401 / 403 | Check the AIMirrorX key, permissions, model restrictions and account status |
| Unknown model or catalog failure | Check the original model name and the metadata required for custom aliases |
| 404 or unsupported protocol | Check the /v1 base URL and Responses support; Chat Completions support alone is insufficient |