Skip to content

Codex setup on Windows and macOS

Create an account → create an API key → find the configuration file → paste the configuration → add your key → restart.

This guide targets Codex CLI and the Codex desktop app; Windows and macOS tests are pending. ChatGPT Desktop compatibility is tracked separately in #38. Do not apply this setup to it based on this guide.

Pending verification: the example model gpt-5.4 has not been confirmed with an AoxToken test account. The model, group, and configuration must be tested before publication; another provider’s tutorial is insufficient evidence.

  1. Open AoxToken registration and follow the registration steps.
  2. Already have an account? Sign in.
  3. Open your dashboard and check your available credits. Follow the purchase instructions if needed.

AoxToken uses its own API keys and account credits, not your ChatGPT subscription allowance.

  1. Open API key management.
  2. Create a key with a recognizable name, such as My Codex.
  3. If you need to select a group, choose one with access to GPT-5.4 and the Responses API.
  4. Copy the key for the next step.

Your API key grants access to your account allowance. Do not share it.

Install and launch Codex once before starting. The example includes the endpoint and model; replace only the API key.

Press Win + R, paste this path and press Enter:

%USERPROFILE%\.codex

Right-click config.toml and choose Open with → Notepad. If the file does not exist, create it. Enable file extensions in File Explorer and make sure it is not named config.toml.txt.

If the file already contains settings, make a backup named config.toml.backup. This is a complete first-time setup. Replace the contents only if there are no custom settings to preserve; otherwise merge the values without duplicating keys or removing MCP settings.

model = "gpt-5.4"
model_provider = "aoxtoken"
forced_login_method = "api"
[model_providers.aoxtoken]
name = "AoxToken"
base_url = "https://api.aoxtoken.com/v1"
wire_api = "responses"
experimental_bearer_token = "PASTE_YOUR_API_KEY_HERE"
supports_websockets = false

Replace PASTE_YOUR_API_KEY_HERE with your AoxToken API key. Keep the straight double quotes and do not add Bearer .

Press Ctrl + S, fully quit the client, reopen it and start a new task.

Install and launch Codex once before starting.

Open Finder, press Command + Shift + G and paste:

~/.codex

Open config.toml with TextEdit. If the folder is missing, launch Codex once and try again. If only the file is missing, open Terminal and run:

Terminal window
touch ~/.codex/config.toml && open -a TextEdit ~/.codex/config.toml

Back up existing contents as config.toml.backup. In TextEdit, turn off Edit → Substitutions → Smart Quotes. Preserve existing MCP or other custom settings when merging.

model = "gpt-5.4"
model_provider = "aoxtoken"
forced_login_method = "api"
[model_providers.aoxtoken]
name = "AoxToken"
base_url = "https://api.aoxtoken.com/v1"
wire_api = "responses"
experimental_bearer_token = "PASTE_YOUR_API_KEY_HERE"
supports_websockets = false

Replace the key placeholder, keeping the straight double quotes and omitting Bearer . Press Command + S, then Command + Q in the client to fully quit. Reopen it and start a new task.

Send: “Hello, please briefly introduce yourself.” Check for a matching request or usage record in the AoxToken dashboard.

Depending on the client version, the model picker may show GPT-5.4 or Custom. A label alone does not prove the request reached AoxToken.

For Codex CLI, restart with:

Terminal window
codex

ChatGPT Desktop is outside this guide’s verification scope. Wait for its separate compatibility document.

Problem What to check
Invalid key or 401 Copy the complete key without extra spaces or a Bearer prefix.
Permission error or 403 Confirm that the key’s group allows GPT-5.4.
Model not found Confirm gpt-5.4 is available to the key, or obtain a supported model ID from AoxToken.
404 Use https://api.aoxtoken.com/v1; do not append /responses.
429 Check credits, request rate and concurrency limits.
Configuration parse error Check straight quotes, duplicate fields and file contents.
Changes have no effect Check the filename and fully restart the client.

When merging settings, place model, model_provider and forced_login_method before the first [section]. This example uses HTTPS streaming without WebSocket. If you set CODEX_HOME, edit the configuration in that directory instead.

Quit the client, restore config.toml.backup as config.toml, then restart. Never upload a file containing your key to a repository or share it. Revoke a leaked key and create a replacement.