Codex CLI
Guide to configuring the OpenAI Codex CLI to call the Minimax model via GreenNode MaaS — using the Responses API through a custom
maasprovider defined incodex.toml.
Prerequisites
Prepare your key, Base URL, and model following Getting Started with AI Coding
Node.js ≥ 22 installed
Pick your configuration by service type
Codex uses the OpenAI standard → the Base URL includes /v1 on both service types. Only the host and the key type differ:
Service type
base_url
Key
model
PAYG
https://maas-llm-aiplatform-hcm.api.vngcloud.vn/v1
API Key from the API Keys page
minimax/minimax-m2.5
Token Plan
https://tokenplan.api.greennode.ai/v1
subscription-key from Plan Detail → Subscription keys tab
Model code on the plan's Models tab
Step 1 — Install Codex CLI
npm install -g @openai/codexConfirm the install succeeded:
Step 2 — Get your key
Log in to the AI Platform Console
Go to API Keys → Create API Key
Name the key (5–50 characters, lowercase letters + numbers + hyphens)
Copy the API key you just created
Go to API Key → Token Plan → My Token Plans and open the plan you bought
Subscription keys tab → copy
default-keyor a key you createdModels tab → copy the Model code of the model you want
No plan yet? See Buy Token Plan.
Step 3 — Configure codex.toml
Create or edit ~/.codex/config.toml (system-wide) or codex.toml in your project root (that project only). Copy the tab matching your service type:
Key fields explained:
model_provider
The provider key under [model_providers.*]
model
Model ID sent to MaaS — PAYG uses the Models portal ID, Token Plan uses the plan's Model code
model_context_window
Declared manually because MaaS doesn't expose model metadata
disable_response_storage
Required for a stateless backend — resends the full conversation each turn
base_url
The endpoint for your service type, including /v1 — Codex appends /responses itself
env_key
Name of the environment variable holding the key
wire_api
Protocol used — responses maps to the OpenAI Responses API
Step 4 — Set the key and run Codex
Export the key in your shell — use the key belonging to the same service type as the base_url you set in Step 3:
To set it automatically every time you open a terminal, add it to ~/.zshrc or ~/.bashrc:
Run Codex in your project directory:
Codex shows the active provider and model in the session header:

Troubleshooting
401 Unauthorized
Key wrong, missing, or not yet ACTIVE
Re-export MAAS_API_KEY; check the key status
401 while the key is still valid
Key and base_url belong to different service types
Re-check the table at the top: a key from the API Keys page → the maas-llm-… host; a key from the Subscription keys tab → the tokenplan… host
403 Forbidden (Token Plan)
Model isn't included in the plan
Set model to a Model code listed on the plan's Models tab
402 Payment Required (Token Plan)
Plan expired or was deleted
Buy the plan again or enable Auto-renew
404 on request
base_url wrong or missing /v1
Codex is OpenAI-standard — base_url must end with /v1 (no /responses)
Context truncated incorrectly
Model metadata not declared
Check model_context_window and model_max_output_tokens in the config
Loses earlier context each turn
disable_response_storage not set
Add disable_response_storage = true to the config
Connection timeout
Endpoint unreachable
Check VPN / connectivity to *.api.vngcloud.vn (PAYG) or tokenplan.api.greennode.ai (Token Plan)
Result
Codex CLI now routes every request through the GreenNode endpoint for your chosen service type. Usage is recorded in the AI Platform Console → Usage.
Use the GUI version
Use OpenCode with MaaS
Connect Claude Code to MaaS
Learn about Token Plan packages
View usage and billing
Need help?
If you've followed the steps and it's still not working, feel free to contact GreenNode Customer Support:
Email: support@greennode.ai
Hotline: 19001549
Help center: helpdesk.greennode.ai
Thank you for using GreenNode's services.
Last updated

