Codex CLI with SayGM

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

Model

GPT-6 LunaBest value

In $0.10$0.08Out $0.50$0.41/1M

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

Sign in

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

13 models
  • GPT-6 Astragpt-6-astraBest qualityOpenAI's top GPT-6 model, for the hardest coding and reasoning work.In $10.00$8.15Out $50.00$40.75/1M
  • GPT-6 Lunagpt-6-lunaBest valueLow-cost GPT-6 for fast coding loops and high-volume agent turns.In $0.10$0.08Out $0.50$0.41/1M
  • GPT-6 Solgpt-6-solMid-priced GPT-6 for day-to-day coding with strong reasoning.In $2.00$1.63Out $10.00$8.15/1M
  • GPT-5.6 Solgpt-5.6-solThe larger GPT-5.6 model, for demanding coding and analysis.In $4.00$3.26Out $20.00$16.30/1M
  • GPT-5.6 Terragpt-5.6-terraMid-sized GPT-5.6 balancing capability and cost.In $2.00$1.63Out $12.00$9.78/1M
  • GPT-5.6 Lunagpt-5.6-lunaLow-cost GPT-5.6 for quick, high-volume requests.In $0.20$0.16Out $1.20$0.98/1M
  • GPT-5.5gpt-5.5GPT-5.5 reasoning model for workflows tuned to it.In $5.00$4.08Out $30.00$24.45/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.04Out $15.00$12.23/1M
  • GPT-5.4 minigpt-5.4-miniSmall GPT-5.4 for fast, inexpensive everyday tasks.In $0.75$0.61Out $4.50$3.67/1M
  • GPT-5.4 nanogpt-5.4-nanoThe smallest GPT-5.4, for classification and simple high-volume calls.In $0.20$0.16Out $1.25$1.02/1M
  • o3OpenAI's o3 reasoning model for multi-step math, science and code.In $2.00$1.63Out $8.00$6.52/1M
  • o4-miniCompact o-series reasoning at a low price.In $1.10$0.90Out $4.40$3.59/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.