Skip to main content

1. Prerequisites

This guide covers the Codex desktop interface on macOS and Windows. Install the client for your system and confirm that its Codex interface opens. Installation paths and UI labels may differ across distributions. For terminal usage, see the Codex CLI guide.
  • An installed application with a working Codex interface.
  • A GravitexAI account with sufficient balance.
  • An API key whose group supports your target GPT model and the Responses API.
For installations with the following bundled CLI path, you can optionally check the version:
If the path does not exist, check your actual installation location. On Windows, check the version in the application’s About or Settings page; the commands above are for macOS only.

2. Test your key and model

Replace the placeholder key below. gpt-6.1-sol is an example: use a model available to your key’s group in the model catalog.
This test incurs a small amount of API usage. It verifies basic access; test desktop tool calls separately below.

3. Configure the provider

Both systems use the same TOML configuration: If CODEX_HOME is set, edit config.toml in that directory. On Windows, press Win + R and enter %USERPROFILE%\.codex to open the default folder. These instructions target the native Windows client; the WSL ~/.codex directory is normally separate. Back up the existing file before editing:
Merge the following into your configuration and replace the key. Update existing fields and tables instead of defining them twice.
Keep top-level fields such as model before the first TOML table. Authorization belongs inside the http_headers table. This table does not have to be last: each new [table] header changes which table subsequent fields belong to.
Static headers store your key in plaintext on this device. The provider also supports env_key, but apps opened from Finder or Launchpad typically do not inherit temporary terminal exports. Verify that the application process can read the variable before using that approach. On Windows, $env:VARIABLE also affects only the current PowerShell session and its child processes; an application opened from Start does not automatically inherit those temporary values.
Save the file and fully quit the application hosting Codex:
  • macOS: use Command + Q.
  • Windows: use the application’s Quit or Exit command, including its system tray menu if it is still running there. If necessary, save your work and end the corresponding application and remaining Codex processes in Task Manager, then reopen from the Start menu.
Start a new local chat after reopening. Closing a window may leave background processes running.

4. Connect through CC Switch

On macOS or Windows, validate your API key and back up the Codex configuration first.
  1. Follow the CC Switch guide, open the Codex page and add a GravitexAI provider.
  2. Enter your key, Base URL https://api.gravitex.ai/v1 and a verified GPT model ID, such as gpt-6.1-sol. Select Responses if a protocol option is shown. CC Switch Codex provider settings showing the API URL and model list
  3. Save and switch to this provider. Confirm that CC Switch updates the same user configuration directory used by the desktop app, including any CODEX_HOME override.
  4. Fully quit and reopen Codex Desktop, then verify chat and tools below.
This procedure uses provider switching. Local routing or aggregation may require CC Switch to remain running. Restart Codex after aggregated model lists change. To revert, switch back to the previous provider or restore your backup while Codex is closed.

5. Connect through Magpie

The request path is Codex Desktop → local Magpie → GravitexAI. Keep the gateway running on either operating system.
  1. Follow the Magpie guide to install it and add provider gravitex with your GravitexAI key and Responses base URL https://api.gravitex.ai/v1. Magpie GravitexAI provider settings showing the OpenAI Responses URL The screenshot uses provider ID gravitexai; the commands below use gravitex. If you use the screenshot’s ID, replace it in the commands, for example magpie codex gravitexai/gpt-6.1-sol.
  2. Fully quit Codex Desktop and back up its configuration.
  3. Run the commands below, replacing the provider and model IDs with your own available values.
  1. Alternatively, enable Codex on Magpie’s Agent page and choose the GravitexAI model. Check that it manages the desktop app’s actual Codex directory.
  2. Keep Magpie running, reopen Codex Desktop and verify chat and tools. For connection failures, check gateway port 3425 (default), localhost proxy handling and upstream permissions.
To return to a direct connection, disconnect Codex in Magpie, restore the previous configuration or select a provider through CC Switch, and fully restart Codex. Use one configuration manager at a time. Local gateway credentials and the upstream GravitexAI key serve different purposes.

6. Verify the desktop connection

  1. Open a local project and create a chat. Check the model or provider selection. Some versions may show Custom; the label alone does not confirm routing.
  2. Send hello and confirm a response.
  3. Ask “List the files in the current directory.” Confirm that a file or terminal tool runs and its result is used in the reply. Grant local permissions when prompted.
  4. Check the corresponding request, model and usage in the GravitexAI console.

7. Troubleshooting

8. Adjustments and key handling

  • To switch models, update top-level model, verify access and restart.
  • Set model_reasoning_effort to low, medium or high as supported by the model. Higher effort usually uses more time and tokens; it does not guarantee better results.
  • Restore your backup to undo changes. To use the official provider, set top-level model_provider = "openai", choose an available official model, restart and sign in as needed.
  • Keep keys out of repositories and shared screenshots. Revoke and replace exposed keys.
  • Cloud tasks, plugins and other account-dependent features vary by client, account and provider support.

9. References