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.4has 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.
Create your account
Section titled “Create your account”- Open AoxToken registration and follow the registration steps.
- Already have an account? Sign in.
- 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.
Create an API key
Section titled “Create an API key”- Open API key management.
- Create a key with a recognizable name, such as
My Codex. - If you need to select a group, choose one with access to GPT-5.4 and the Responses API.
- Copy the key for the next step.
Your API key grants access to your account allowance. Do not share it.
Windows
Section titled “Windows”Install and launch Codex once before starting. The example includes the endpoint and model; replace only the API key.
Find the configuration file
Section titled “Find the configuration file”Press Win + R, paste this path and press Enter:
%USERPROFILE%\.codexRight-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.
Paste the configuration
Section titled “Paste the configuration”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 = falseAdd your key, save and restart
Section titled “Add your key, save and restart”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.
Find the configuration file
Section titled “Find the configuration file”Open Finder, press Command + Shift + G and paste:
~/.codexOpen 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:
touch ~/.codex/config.toml && open -a TextEdit ~/.codex/config.tomlPaste the configuration
Section titled “Paste the configuration”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 = falseAdd your key, save and restart
Section titled “Add your key, save and restart”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.
Check the connection
Section titled “Check the connection”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:
codexChatGPT Desktop is outside this guide’s verification scope. Wait for its separate compatibility document.
Troubleshooting
Section titled “Troubleshooting”| 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.
Restore your previous configuration
Section titled “Restore your previous configuration”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.