~/.codex/config.toml.
Codex works with GPT models:
gpt-5.4, gpt-5.5, the gpt-5.6 series, gpt-6-astra. Codex only sends Responses API requests, and on RuAPI that API is available for GPT models. For Claude use Claude Code; for DeepSeek, Claude Code on DeepSeek.Prerequisites
1
RuAPI account + API key
Console → API Keys → Create API key. See API keys & security.
2
Node.js with npm
Install Codex CLI
Configure RuAPI
Edit~/.codex/config.toml (or %USERPROFILE%\.codex\config.toml on Windows). Create it if missing:
~/.zshrc / ~/.bashrc):
- macOS / Linux
- Windows (PowerShell)
First call
Switch models
Inside a session:model = "..." at the top of config.toml. Any GPT model from the pricing page works.
Troubleshooting
Model not found (503) or 404
Model not found (503) or 404
- A typo in the model ID. GPT model names on RuAPI match the official ones — copy exact names from the pricing page.
base_urlmust end in/v1.
Error: wire_api = 'chat' is no longer supported
Error: wire_api = 'chat' is no longer supported
Your config is from an older Codex. In
config.toml, change wire_api = "chat" to wire_api = "responses".I picked Claude or DeepSeek and the request fails
I picked Claude or DeepSeek and the request fails
That’s expected: Codex only works through the Responses API, which on RuAPI is available for GPT models. For Claude and DeepSeek, use Claude Code — every model works there.
Tool calling / function calling errors
Tool calling / function calling errors
RuAPI forwards tool calls unchanged. If Codex complains, try the same prompt directly against OpenAI to rule out a prompt-side issue.
Keep both the official account and RuAPI
Keep both the official account and RuAPI
The easiest way to switch is CC Switch. By hand, change
model_provider at the top of config.toml.