Clients
Codex
Use goodapi in the OpenAI Codex CLI — add a model provider in config.toml that uses the Responses API, and fix common problems.
Updated
Codex uses the OpenAI Responses API and needs a key from the ChatGPT group, with GPT models.
Configuration
Edit ~/.codex/config.toml (create it if it doesn't exist) and add a model provider:
model = "gpt-5.6-luna"
model_provider = "goodapi"
[model_providers.goodapi]
name = "goodapi"
base_url = "https://api.goodapi.tech/v1"
env_key = "GOODAPI_API_KEY"
wire_api = "responses"Then put your key in the GOODAPI_API_KEY environment variable and start Codex:
export GOODAPI_API_KEY="sk-..." # key from the ChatGPT group
codexbase_urlincludes/v1.env_keyis the name of the environment variable that holds the key. You can rename it, as long as it matches yourexport.wire_apimust beresponses.
Choosing models
Set model to a ChatGPT group model from Models and pricing. To switch temporarily, run codex -m <model>, or use /model inside Codex.
Checking it works
codex exec "Reply with exactly: ok"Outside a Git repository, add --skip-git-repo-check. If it replies ok and the request shows up on the Usage Logs page of the console, Codex is going through goodapi.
Troubleshooting
401: make sure the terminal you started Codex from has exported the variable named in env_key, and that the key is valid; see Error codes.
403 This token has no access to model: the key isn't from the ChatGPT group, or model isn't a model in that group.
Can I use Claude models? No. Codex only uses the Responses API, which Claude models don't support. To use Claude and other models in one tool, try opencode.