What is Codex?
Codex is an agentic coding system that can plan, write, and run code across long-running development tasks. It integrates with OpenAI-compatible APIs, so you can point Codex to Routify to access Codex models through a single gateway.Setup
Recommended: Set OpenAI-Compatible Environment Variables
The simplest way to configure Codex with Routify is to set the standard OpenAI-compatible environment variables:Quick Start (CLI)
After setting your environment variables, run Codex as usual:Manual Configuration
Step 1: Get Your Routify API Key
- Sign up or log in at routify.ru
- Create a new API key
- Copy your key (starts with
sk-...)
Step 2: Set Your API Key
Set your API key as an environment variable:OPENAI_API_KEY and OPENAI_BASE_URL:
Routify is OpenAI-compatible. You don’t need a custom SDK—any OpenAI-compatible client should work.
Step 3: Choose Your Model
Pick a model ID from the Routify catalog and set it in Codex. Here are common Codex choices: Codex Mini (fast, cost‑efficient):Step 4: Start Codex
Run Codex and begin a session:Model Format
Routify model IDs typically use the format<provider>/<model>, for example:
openai/gpt-5.1-codex-miniopenai/gpt-5.1-codexopenai/gpt-5.1-codex-max
Reliability and Failover
Routify automatically routes requests across available providers when possible. If a provider is unavailable, requests can fail over to another upstream without changes to your Codex configuration.Common Errors
”No API key found”
Codex can’t find your Routify API key. Fix:- Ensure
ROUTIFY_API_KEYandOPENAI_API_KEYare set:echo $ROUTIFY_API_KEY - Verify
OPENAI_BASE_URLis set tohttps://api.routify.ru/v1 - Restart your terminal session and re-run
codex
Authentication errors (401/403)
If you see authentication errors: Fix:- Verify your API key is valid on routify.ru
- Check that you have sufficient balance
- Ensure your key hasn’t been revoked
Model not working
If a specific model isn’t working: Fix:- Verify the model ID in the Routify catalog
- Use the
<provider>/<model>format (e.g.,openai/gpt-5.1-codex-mini) - Try a different Codex model