For the complete documentation index, see llms.txt. This page is also available as Markdown.

Codex CLI

Guide to configuring the OpenAI Codex CLI to call the Minimax model via GreenNode MaaS — using the Responses API through a custom maas provider defined in codex.toml.


Prerequisites


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/codex

Confirm the install succeeded:


Step 2 — Get your key

  1. Log in to the AI Platform Console

  2. Go to API Keys → Create API Key

  3. Name the key (5–50 characters, lowercase letters + numbers + hyphens)

  4. Copy the API key you just created

  1. Go to API Key → Token Plan → My Token Plans and open the plan you bought

  2. Subscription keys tab → copy default-key or a key you created

  3. Models 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:

model must match the Model code exactly as shown on the plan's Models tab, and that model must be included in the plan — calling a model outside the plan returns 403 Forbidden.

Key fields explained:

Field
Purpose

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:

Codex running with the minimax/minimax-m2.5 model via GreenNode MaaS

Troubleshooting

Symptom
Cause
Fix

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.

I want to next...
Go to

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:

Thank you for using GreenNode's services.

Last updated