Setup Codex
Configure Codex to call Agorian through the Responses API.
Agorian exposes POST /v1/responses, the endpoint Codex should use through a
dedicated provider in ~/.codex/config.toml.
1. Export the key
Keep the key out of the repository.
export AGORIAN_API_KEY="sk-..."2. Add the provider
# ~/.codex/config.toml
model = "gpt-5.4"
model_provider = "agorian"
[model_providers.agorian]
name = "Agorian"
base_url = "https://api.agorian.ai/v1"
env_key = "AGORIAN_API_KEY"
wire_api = "responses"env_key tells Codex which local environment variable should sign requests.
wire_api = "responses" selects the format expected by /v1/responses.
3. Run Codex
codexFor a one-off test without changing the persistent config:
codex \
--config model='"gpt-5.4"' \
--config model_provider='"agorian"' \
--config 'model_providers.agorian={ name="Agorian", base_url="https://api.agorian.ai/v1", env_key="AGORIAN_API_KEY", wire_api="responses" }'Alternative: override the OpenAI provider
Codex also documents openai_base_url for pointing the built-in OpenAI provider
at a custom base URL. Use it in the user config, not a project
.codex/config.toml, since Codex does not redirect credentials from project
configuration.
# ~/.codex/config.toml
openai_base_url = "https://api.agorian.ai/v1"Quick verification
curl https://api.agorian.ai/v1/responses \
-H "Authorization: Bearer $AGORIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4","input":"Reply with ok"}'Sources: Codex advanced configuration and Codex environment variables.