Codex charges by actual token usage — through the Cho Tai Khoan gateway you pay a fixed package from $0.72 (≈ 19.000đ) instead of per-call USD billing. Just set 1 environment variable and paste 1 configuration block into the Codex config.toml file.
npm install -g @openai/codex
Check the install: run codex --version — a version number means you are good.
sk-ctk-.Create an environment variable named CTK_API_KEY with your key as its value:
Open a command window: on Windows press Start, type PowerShell, press Enter. On macOS press Cmd + Space, type Terminal, press Enter.
If you have already checked your key on the home page in the same browser, the key in the boxes below is already filled in for you — just copy them as-is, no manual editing.
macOS / Linux — add to ~/.zshrc or ~/.bashrc:
export CTK_API_KEY="KEY_CUA_BAN"
Windows — PowerShell:
setx CTK_API_KEY "KEY_CUA_BAN"
Open the Codex config.toml file and paste this block. The file lives in the .codex folder in your user folder: on Windows that is C:\Users\<your name>\.codex, on macOS / Linux it is ~/.codex/. If the folder or file does not exist yet, create it.
Windows note: if you create the file with Notepad, in the save dialog set "Save as type" to All Files and name the file exactly config.toml — with the default setting Notepad saves it as config.toml.txt and Codex cannot read it.
model_provider = "chotaikhoan" model = "gpt-6-astra" [model_providers.chotaikhoan] name = "Cho Tai Khoan API" base_url = "https://api.chotaikhoan.com/v1" env_key = "CTK_API_KEY" wire_api = "responses"
The model line is the default model — switch it to any model in the list of 26 models (Claude, GPT, Gemini, DeepSeek…) and it runs on the same key.
Reopen Codex (fully close the command window and open it again so the environment variable takes effect) and type: "Reply with exactly one word: running". An answer of "running" means you are done.
The Starter package is enough to set up and test Codex, Claude Code, Cursor and Cline on a single key. Happy with it? Top up later — quota stacks, nothing you bought is lost.
View packages — from $0.72🔑 Redeem a code for a key