Codex CLI with SayGM

OpenAI's coding CLI, running on SayGM's GPT models.

Model

GPT-6 LunaBest value

In $0.10$0.06Out $0.50$0.28/1M

Sign in to fill these snippets with a SayGM key for Codex CLI.

Sign in

Set up in one command

Signs you in, creates a key for this tool, installs the tool if it is missing, and writes its config. Run npx saygm uninstall codex to put the files back.

  1. 1Run the installer
    bash
    npx saygm install codex --model gpt-6-luna

Requires Node.js 22 or later.

SayGM CLI on npm

Setup for GPT models

Use this setup with the models listed under GPT below.

  1. 11 · ~/.codex/config.toml
    toml
    model = "gpt-6-luna"
    model_provider = "saygm"
    
    [model_providers.saygm]
    name = "SayGM"
    base_url = "https://api.saygm.com/v1"
    env_key = "SAYGM_API_KEY"
    wire_api = "responses"
  2. 22 · Set the key, then run
    bash
    export SAYGM_API_KEY="<YOUR_SAYGM_KEY>"
    codex

To run another model, start Codex with codex -m gpt-6-astra, or change model in config.toml.

First request

  1. 1Send a first request
    bash
    codex exec "say gm"

Troubleshooting

Every command fails at startup with `wire_api = "chat"` is no longer supported.
Codex no longer accepts that setting. Set wire_api = "responses" in the [model_providers.saygm] table.
Codex asks you to sign in with ChatGPT.
Check that model_provider = "saygm" sits at the top of config.toml, above every table, and that requires_openai_auth is not set.
401 Unauthorized.
Codex reads the key from SAYGM_API_KEY in the shell that runs it. Export it there, or add it to your shell profile.
Tools or reasoning behave oddly on a model.
Codex tunes itself from its own list of OpenAI model ids. Use a real OpenAI id such as gpt-6-luna.

Models you can use with Codex CLI

Codex is built for OpenAI's models, so it runs SayGM's GPT models.

GPT

15 models
  • GPT-6 Astragpt-6-astraBest qualityOpenAI's top GPT-6 model, for the hardest coding and reasoning work.In $10.00$5.67Out $50.00$28.33/1M
  • GPT-6 Lunagpt-6-lunaBest valueLow-cost GPT-6 for fast coding loops and high-volume agent turns.In $0.10$0.06Out $0.50$0.28/1M
  • GPT-6.1 Solgpt-6.1-solNear-Astra GPT-6 for complex coding and computer use at a lower price.In $2.00$1.13Out $10.00$5.67/1M
  • GPT-6.1 Terragpt-6.1-terraFast GPT-6.1 for visual reasoning and computer use.In $1.00$0.61Out $5.00$3.04/1M
  • GPT-6 Solgpt-6-solMid-priced GPT-6 for day-to-day coding with strong reasoning.In $2.00$1.13Out $10.00$5.67/1M
  • GPT-5.6 Solgpt-5.6-solThe larger GPT-5.6 model, for demanding coding and analysis.In $4.00$2.27Out $20.00$11.33/1M
  • GPT-5.6 Terragpt-5.6-terraMid-sized GPT-5.6 balancing capability and cost.In $2.00$1.13Out $12.00$6.80/1M
  • GPT-5.6 Lunagpt-5.6-lunaLow-cost GPT-5.6 for quick, high-volume requests.In $0.20$0.11Out $1.20$0.68/1M
  • GPT-5.5gpt-5.5GPT-5.5 reasoning model for workflows tuned to it.In $5.00$4.38Out $30.00$26.27/1M
  • GPT-5.5 Progpt-5.5-proGPT-5.5 with extra compute per answer, for the toughest single problems.In up to $30.00Out up to $180.00/1M
  • GPT-5.4gpt-5.4GPT-5.4 for general coding and writing at a moderate price.In $2.50$2.19Out $15.00$13.13/1MOffered by miners now
  • GPT-5.4 minigpt-5.4-miniSmall GPT-5.4 for fast, inexpensive everyday tasks.In $0.75$0.66Out $4.50$3.94/1MOffered by miners now
  • GPT-5.4 nanogpt-5.4-nanoThe smallest GPT-5.4, for classification and simple high-volume calls.In $0.20$0.18Out $1.25$1.09/1M
  • o3OpenAI's o3 reasoning model for multi-step math, science and code.In $2.00$1.75Out $8.00$7.00/1MOffered by miners now
  • o4-miniCompact o-series reasoning at a low price.In up to $1.10Out up to $4.40/1M

About Codex CLI

Codex CLI is OpenAI's open-source coding agent for the terminal. It reads your project, proposes and applies edits, and runs commands in a sandbox you control. Developers use it for hands-on coding sessions and for scripted, non-interactive runs with codex exec.