Skip to content

Codex

Codex can use an OpenAI-compatible gateway. Configure the OpenAI base URL as R9S and use your R9S API key.

Terminal window
export R9S_API_KEY="<R9S_API_KEY>"
export OPENAI_BASE_URL="https://api.r9s.ai/"
export OPENAI_API_KEY="$R9S_API_KEY"

Use an OpenAI-compatible model available through R9S:

Terminal window
codex --model gpt-5-codex

If you want Codex to proceed without additional prompts, use:

Terminal window
codex --model gpt-5-codex --full-auto

For a one-shot prompt:

Terminal window
codex --model gpt-5-codex "Review this repository and summarize the main risks."

Add the variables to your shell profile:

Terminal window
export R9S_API_KEY="<R9S_API_KEY>"
export OPENAI_BASE_URL="https://api.r9s.ai/"
export OPENAI_API_KEY="$R9S_API_KEY"

Restart your shell after updating the profile.

SymptomCheck
Authentication errorConfirm OPENAI_API_KEY is set to your R9S API key.
Model not foundConfirm gpt-5-codex or your selected model is available in R9S.
Requests use the default OpenAI endpointConfirm OPENAI_BASE_URL is exported before starting Codex.