~/.codex/config.toml. SnapGen’s /v1/responses route was verified with the current Codex CLI and GPT text models.
Prerequisites
- Install or update Codex CLI and confirm
codex --versionworks. - Create a SnapGen API key and add prepaid balance.
- Use a current text model.
gpt-5.4-miniis the lowest-cost starting point.
Set the API key
config.toml.
Add the provider
Edit~/.codex/config.toml:
wire_api must be responses. Current Codex versions do not use Chat Completions for custom agent sessions.
Verify
provider: snapgen and your selected model. Use codex for an interactive session.
Switch models
Change the top-levelmodel value, or override it for one run:
gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.6, gpt-5.6-luna, gpt-5.6-sol, and gpt-5.6-terra.
Troubleshooting
Codex opens a ChatGPT sign-in flow
Codex opens a ChatGPT sign-in flow
Confirm
model_provider = "snapgen" is at the top level and the provider
block has the same snapgen identifier.Codex reports a missing API key
Codex reports a missing API key
Export
SNAPGEN_API_KEY in the shell that launches Codex. The env_key
field names the variable; it does not contain the secret itself.The provider rejects wire_api
The provider rejects wire_api
Set
wire_api = "responses" and update Codex CLI. Do not use chat with a
current version.Plugin or hosted OpenAI features return 401
Plugin or hosted OpenAI features return 401
Custom inference routes do not authenticate hosted ChatGPT services. Core
Codex agent requests can work while optional OpenAI-hosted features remain
unavailable.