Node/npm and Codex CLI
Run node -v and npm -v. If missing, install Node.js first, then run npm install -g @openai/codex@latest to update Codex CLI.
CODEX CONFIGURATION
Register, fund the account, create an API key, check the local environment, configure Codex, verify Usage, and troubleshoot the getaitoken.com OpenAI-compatible Responses API.
This public guide only shows placeholders; real API keys are only visible on the signed-in API Keys page. Log out of any old Codex account, fully quit the app, then restart after setup.
Follow the real setup path: prepare account credit, create a key, then use import or manual Codex configuration.
Create a getaitoken.com account and open the console.
Make sure the account or subscription has usable balance; insufficient balance will make Codex calls fail.
Create a key on API Keys and confirm it belongs to an available OpenAI group.
Prefer the one-click import on API Keys; for audited setup, write config.toml, auth.json, and the Windows user-level environment variable manually.
Fully quit Codex, restart it, then verify with /v1/models, a test prompt, and Usage records.
Check the local runtime first, then choose one-click import, manual setup, or file-level review, all through the OpenAI-compatible API.
Run node -v and npm -v. If missing, install Node.js first, then run npm install -g @openai/codex@latest to update Codex CLI.
Run codex once in a terminal. If ~/.codex or %USERPROFILE%\.codex does not exist, let the client create it before writing config.
Back up existing config, then write config.toml and auth.json under the user-level .codex directory. On Windows, also set user-level OPENAI_API_KEY.
The snippets below use the current getaitoken public API Base URL and normalize it with /v1. Real keys are generated only on the signed-in API Keys page.
When troubleshooting or auditing, work file by file. Do not confuse a project-level .codex directory with the user-level config directory.
Use ~/.codex on macOS/Linux and %USERPROFILE%\.codex on Windows. If it does not exist, run codex once first.
Copy config.toml and auth.json to timestamped backup files before editing.
Keep model_provider = "getaitoken", base_url = "https://api.getaitoken.com/v1", wire_api = "responses", and requires_openai_auth = true.
Store only OPENAI_API_KEY, using a real user key generated on getaitoken API Keys. Public guide keys are placeholders.
Use PowerShell to write user-level OPENAI_API_KEY, then reopen the terminal or fully restart Codex.
After Codex is configured, continue with Web chat, Responses, and Image APIs.
Useful for checking model behavior, prompts, and balance without a local Codex runtime.
Codex uses wire_api = "responses"; applications can also call /v1/responses directly.
Use /v1/images/generations for generation and /v1/images/edits for edits; use /v1/responses for image tools inside text workflows.
A common question is "which models can my account use?" The most accurate answer comes from /v1/models, which only returns models the current key can actually call.
Run curl https://api.getaitoken.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY". It returns the OpenAI list shape {object:"list", data:[{id, owned_by, ...}]}; the id values are exactly the models this key can call, already filtered by the group and platform whitelist.
After signing in, visit /available-channels to see the models, groups, and pricing multipliers your account supports. It redirects to /login when not signed in.
Use /keys to create or manage a key. A key without an assigned group has no model quota, so confirm the group is set.
If a model id is absent from /v1/models, the key's group does not include it. Check /available-channels or contact support. This platform currently offers OpenAI capabilities only.
Base URL is https://api.getaitoken.com/v1, authenticated with Authorization: Bearer. The endpoints below are the OpenAI-compatible routes actually served today.
Root-level aliases without /v1 also work, but configure clients with /v1 for consistency.
Check in this order to isolate key, endpoint, model, or client-cache issues.
A key without an assigned group cannot use model quota.
Codex needs the OpenAI-compatible API root path; import and config generators append it automatically.
If ~/.codex or %USERPROFILE%\.codex does not exist, run codex once so the client creates it.
If Codex / ChatGPT is still signed in with an old account, sign out first. Fully restart Codex after changing key, model, or Base URL.
Usage is the final verification. A matching request should appear with model, request count, and spend.
These cover common OpenAI-compatible Codex setup issues.
Call GET /v1/models (curl https://api.getaitoken.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"); the returned id values are the models this key can use. You can also sign in and open /available-channels to see supported models and pricing visually.
Prefer the /v1 endpoint for Codex OpenAI-compatible config. The guide and modal generator append /v1 automatically.
Confirm Node.js and npm are available, then install or update Codex CLI with npm install -g @openai/codex@latest. Run codex once before setup so the user-level .codex directory exists.
Use ~/.codex on macOS/Linux and %USERPROFILE%\.codex on Windows. On macOS, press Command+Shift+G in Finder and enter ~/.codex. On Windows, press Win+R and enter %userprofile%\.codex. If the directory does not exist, run codex once first, then create config.toml and auth.json if needed.
Codex has reserved meanings for built-in provider ids. This guide uses getaitoken as a custom provider to avoid confusion with official OpenAI config.
Check account balance, order status, or redeemed credit first, then confirm the API key group enables the target OpenAI model. Use /v1/models before changing model IDs.
No. Standard Responses mode is enough. WebSocket is an advanced option, and the Codex Desktop Fast toggle still depends on client capability detection.
Check terminal font and encoding first. If it still happens, press Win+R, run intl.cpl, open the Administrative tab, choose Change system locale, enable Unicode UTF-8 for worldwide language support, save, reboot, and open Codex again.
Keep base_url ending in /v1, for example https://api.getaitoken.com/v1; do not put /responses in base_url. From the exact machine or container that runs the failing task, curl both /v1/models and /v1/responses. If /v1/models also returns connection refused, check DNS, outbound 443, firewall rules, HTTP(S)_PROXY/NO_PROXY, CLI sandboxing, or container networking. If image workers work but vision/review workers fail, compare proxy, DNS, and API key inheritance between those workers.
The guide asks you to back up config.toml and auth.json first. Do not delete old files; restore from the backup if needed.
Rotate keys by editing auth.json; on Windows, also update the user-level OPENAI_API_KEY environment variable. Change service URLs by updating base_url with /v1, and check /v1/models before updating both model and review_model.
Global instructions should live in the AGENTS.md file that Codex reads; restart Codex or the editor after changing it. Web search is a client capability. If your Codex version supports it, enable it using Codex config semantics; getaitoken only handles OpenAI-compatible API forwarding and Usage records.
Restart Codex, send a test prompt, and confirm Model provider is getaitoken.com - https://api.getaitoken.com/v1, Account is API key configured, and a matching request appears on Usage.
getaitoken keeps image support on OpenAI-compatible paths: use /v1/images/generations for image generation and /v1/images/edits for edits. When a text workflow calls an image tool, use /v1/responses with an image_generation tool. Images are returned in data[0].b64_json by default; decode the Base64 payload into a PNG. Set n for multiple images, and keep uploaded edit inputs under 50MB. The API key group must enable allow_image_generation, otherwise the API returns Image generation is not enabled for this group. curl https://api.getaitoken.com/v1/images/generations \ -H "Authorization: Bearer <getaitoken user API key>" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A clean product rendering of an AI API dashboard", "size": "1024x1024", "quality": "high", "response_format": "b64_json" }' curl https://api.getaitoken.com/v1/images/edits \ -H "Authorization: Bearer <getaitoken user API key>" \ -F "model=gpt-image-2" \ -F "image[][email protected]" \ -F "prompt=Replace the background with a clean office scene" \ -F "size=1024x1024" \ -F "quality=high" \ -F "response_format=b64_json" curl https://api.getaitoken.com/v1/responses \ -H "Authorization: Bearer <getaitoken user API key>" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "input": "Generate a product hero image for an AI API gateway.", "tools": [ { "type": "image_generation", "model": "gpt-image-2", "size": "1024x1024", "quality": "high" } ], "tool_choice": { "type": "image_generation" } }' import OpenAI from "openai"; import { writeFileSync } from "fs"; const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, baseURL: "https://api.getaitoken.com/v1", }); const result = await client.images.generate({ model: "gpt-image-2", prompt: "A clean product rendering of an AI API dashboard", size: "1024x1024", quality: "high", response_format: "b64_json", }); writeFileSync("out.png", Buffer.from(result.data[0].b64_json, "base64"));
Sign in, open API Keys, copy the real key or use import, then restart Codex.