Use a compatible API in Codex-style developer tools
Point a client that supports a custom OpenAI-compatible endpoint at relay.fast, then validate the model, responses format, streaming, and tool permissions used by your version.
Core settings
- Base URL:
https://relay.fast/v1. - Authentication: a relay.fast API key stored outside source code.
- Model: an identifier currently returned by
/v1/models. - Timeout and retry policy: explicit values appropriate for coding tasks and CI.
Test before automation
Start with read-only or sandboxed tasks. Check diff quality, tool-call behavior, token usage, and failure recovery before allowing writes, shell commands, or unattended CI actions.
Configuration example
Add a provider to ~/.codex/config.toml:
model = "gpt-6.1-sol"
model_provider = "relayfast"
[model_providers.relayfast]
name = "relay.fast"
base_url = "https://relay.fast/v1"
env_key = "RELAY_FAST_API_KEY"
wire_api = "responses"
requires_openai_auth = falseKeep the key in the environment variable the provider names:
# macOS and Linux
export RELAY_FAST_API_KEY=sk-your-api-key
# Windows (PowerShell), then open a new terminal
setx RELAY_FAST_API_KEY sk-your-api-keyA profile selected with codex --profile can override the provider, so check it after a restart.
One-command setup
The script configures Codex for relay.fast. It adds the provider, stores the key in the RELAY_FAST_API_KEY variable and checks that requests reach relay.fast. It asks for the API key inside the script, so the key never appears in the command or shell history. Every downloaded file is checked against a published SHA-256 checksum, and running it again can restore the previous settings.
Windows (PowerShell):
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://relay.fast/downloads/setup/install-codex-en.ps1 | iex"macOS and Linux:
curl -fsSL https://relay.fast/downloads/setup/install-codex-en.sh | bashYou can read the script before running it by opening the same URL in a browser.
Current prices of models for coding agents
Prices checked from the live catalog. "From" is the lowest price among the relay.fast sources that currently serve the model. The price you pay depends on the source your request uses and can change on any day. The pricing page always shows current values.
| Model | Model ID | Official input / output per 1M tokens | relay.fast from, input / output | Cache read from | Context |
|---|---|---|---|---|---|
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2 / $10 | $0.238 / $1.19 (−88%) | $0.0238 | 1M |
| Claude Opus 5.5 | claude-opus-5-5 | $4 / $20 | $0.111 / $0.556 (−97%) | $0.00556 | 1M |
| GPT-6.1 Sol requests above 272K input tokens cost more | gpt-6.1-sol | $2 / $10 | $0.03 / $0.15 (−98%) | $0.0015 | 1.05M |
| GLM-5.3 | glm-5.3 | $1.4 / $4.4 | $0.035 / $0.11 (−97%) | $0.0065 | 1M |
| Kimi K3 | kimi-k3 | $3 / $15 | $0.15 / $0.75 (−95%) | $0.015 | 1.05M |
| DeepSeek V4.1 Flash price depends on the time of day; the peak-hours price is shown | deepseek-v4.1-flash | $0.3 / $1.2 | $0.03 / $0.12 (−90%) | $0.0006 | 1M |
Frequently asked questions
Is Codex the same as the OpenAI API?
Codex-style clients and the OpenAI API are related but client capabilities differ. Follow the client version's endpoint and responses requirements.
Can I use the chat completions endpoint?
Use the endpoint supported by your client. relay.fast documents both compatible request families where enabled; verify the current model catalog.
How should CI keys be handled?
Use a dedicated least-privilege key in the CI secret store, never in repository files or logs.