Documentation / Connect

Connect → Codex CLI

Use AxForge with Codex CLI

Codex CLI is OpenAI's coding agent for the terminal. It speaks the Responses API, and AxForge serves that too. Add AxForge as a provider in its config file and it runs on your key.

Before you start
  • An AxForge API key. Get one (a minute).
  • Node.js 18 or newer. This guide was tried with Codex CLI 0.163.0 on 2026-10-17.

Set it up

  1. Install Codex

    npm install -g @openai/codex
  2. Add AxForge to its config

    Create ~/.codex/config.toml (on Windows %USERPROFILE%\.codex\config.toml):

    model = "qwen3.8-27b-nvfp4"
    model_provider = "axforge"
    model_context_window = 262144
    
    [model_providers.axforge]
    name = "AxForge"
    base_url = "https://api.axforge.ai/v1"
    env_key = "AXFORGE_API_KEY"
    wire_api = "responses"

    The file holds no key: env_key tells Codex to read it from the AXFORGE_API_KEY environment variable. model_context_window tells it that our models read 262,144 tokens at once, so it shortens a long session before it reaches that.

    The Codex config file in a terminal, with the model qwen3.8-27b-nvfp4, model_context_window 262144 and the AxForge provider
  3. Put your key in the environment

    export AXFORGE_API_KEY="orx_live_your_key_here"

    It lasts until you close this terminal. Start Codex from the same one.

  4. Start it in your project

    cd my-project
    codex

    The first time in a folder it asks whether you trust it. Trust and continue lets it read and change the files there.

    Codex asking whether to trust the project folder, with Trust and continue selected
  5. Give it a task

    Ask in plain words. The line under the message box names the model it runs on.

    Codex adding a function is_even to utils.py and showing the file, on qwen3.8-27b-nvfp4

The settings

SettingValue
base_urlhttps://api.axforge.ai/v1
wire_apiresponses
env_keyAXFORGE_API_KEY (the variable that holds your key)
model_context_window262144
modelqwen3.8-27b-nvfp4, glm-5.3-flash or mimo-v2.6-flash

Which model for what: qwen3.8-27b-nvfp4 is the everyday default and reads images, glm-5.3-flash thinks before it answers, mimo-v2.6-flash is the fastest. To try another one for a single run: codex -m glm-5.3-flash.

Check that it works

The line under the message box names your model and a task gets done. The calls show in the console under API Keys → Recent calls within a minute.

When it does not work

What you seeWhat it meansFix
"Missing environment variable: AXFORGE_API_KEY"the key is not in this terminalset it as in step 3, in the same terminal, then start Codex again
"Model metadata for qwen3.8-27b-nvfp4 not found"Codex knows only OpenAI's model namesnothing: it is a warning, and it runs
"unexpected status 401 Unauthorized: Invalid API key. Create one at https://console.axforge.ai/keys."the key was refusedpaste it again, whole, or make a new one

Test a call says in one click whether a problem is your key, your balance or us.

Ask on the forum Markdown For AI Updated 2026-10-17

Anything unclear on this page?

Ask on the forum. The answer helps the next person too.

Ask about this page