Skip to content
Auto
English

Codex custom API provider setup

This page configures Codex directly. To switch Codex and Claude providers from one desktop app, use the CC Switch guide.

  • Install Codex and confirm the codex command runs.
  • Create a Relyven key that can use the model you need.
  • Copy the exact model ID from the dashboard.

Edit the user-level ~/.codex/config.toml, not a project .codex/config.toml:

model = "YOUR_MODEL_ID"
model_provider = "relyven"
[model_providers.relyven]
name = "Relyven"
base_url = "https://api.relyven.com/v1"
env_key = "RELYVEN_API_KEY"
wire_api = "responses"

Put the key in an environment variable:

Terminal window
export RELYVEN_API_KEY="YOUR_API_KEY"
codex

The Base URL must include /v1. Codex appends /responses, so do not enter the complete endpoint in base_url.

Check the API before testing the client:

Terminal window
curl https://api.relyven.com/v1/responses \
-H "Authorization: Bearer $RELYVEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","input":"Reply with OK."}'

Then start a new Codex task that requires a tool call. Relyven supports /v1/responses and the legacy /responses compatibility path.

Relyven does not intentionally change tools, reasoning fields, service tier, session fields, context, or the requested model. Unsupported combinations may still be rejected by the selected model.

Result Check
401 RELYVEN_API_KEY is exported in the shell that starts Codex
403 The key can use the configured model
400 wire_api = "responses", model ID, and request fields
Model not found Copy the ID from the authenticated model list or dashboard
Configuration did not change Exit Codex completely and start a new session

See Responses API for request fields and API error handling for retry guidance.