Codex
Codex can use an OpenAI-compatible gateway. Configure the OpenAI base URL as R9S and use your R9S API key.
Environment Variables
Section titled “Environment Variables”export R9S_API_KEY="<R9S_API_KEY>"export OPENAI_BASE_URL="https://api.r9s.ai/"export OPENAI_API_KEY="$R9S_API_KEY"Run Codex
Section titled “Run Codex”Use an OpenAI-compatible model available through R9S:
codex --model gpt-5-codexIf you want Codex to proceed without additional prompts, use:
codex --model gpt-5-codex --full-autoFor a one-shot prompt:
codex --model gpt-5-codex "Review this repository and summarize the main risks."Persistent Shell Setup
Section titled “Persistent Shell Setup”Add the variables to your shell profile:
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.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
| Authentication error | Confirm OPENAI_API_KEY is set to your R9S API key. |
| Model not found | Confirm gpt-5-codex or your selected model is available in R9S. |
| Requests use the default OpenAI endpoint | Confirm OPENAI_BASE_URL is exported before starting Codex. |