Codex CLI

Install Codex CLI and add Relayvia to ~/.codex/config.toml.

Codex CLI uses the OpenAI Responses format (/v1/responses).

Install

Install it with npm; it needs a recent Node.js.

Terminal
npm install -g @openai/codex

Config file

Add this to ~/.codex/config.toml. The API key is not stored in the file; it is read from the environment variable named in env_key.

~/.codex/config.toml
model = "gpt-5.5"
model_provider = "relayvia"

[model_providers.relayvia]
name = "Relayvia"
base_url = "https://api.relayvia.dev/v1"
env_key = "RELAYVIA_API_KEY"
wire_api = "responses"

Replace sk-... with an API key from the console.

These settings were verified with version 0.166.0.

Environment variables

Set RELAYVIA_API_KEY and start Codex CLI; we recommend adding it to your shell profile.

Terminal
export RELAYVIA_API_KEY=sk-...
codex

Troubleshooting

SymptomCauseFix
401 invalid_api_keyWrong, disabled or expired API keyCheck the key's status in the console and copy the full string starting with sk-; create a new key if needed.
402 insufficient_quotaThe account's credits, the key's limit or the team member's limit is used up, or the account is frozenTop up, or ask an admin to raise the limit. Retrying will not help.
403 forbiddenThe key may not use the model, the source IP is not on the allowlist, or the account is disabledCheck the key's allowed models and IP allowlist; use official model names as listed by /v1/models.
429 rate_limitedToo many requestsWait for Retry-After and retry; contact us if you regularly need more.
Cannot connect (timeout, DNS error or 404)Wrong base URL or no network accessMake sure base_url is https://api.relayvia.dev/v1 and wire_api is responses. Test the network with curl https://api.relayvia.dev/v1/models.
The model never searches the webWeb search is not available; Relayvia removes the search tool so the rest of the request still worksNo change needed. Paste the information into the conversation when the model needs it.