Setup Codex
Configure Codex to call Arcflow through the Responses API.
Arcflow 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 ARCFLOW_API_KEY="sk-..."2. Add the provider
# ~/.codex/config.toml
model = "gpt-5.4"
model_provider = "arcflow"
[model_providers.arcflow]
name = "Arcflow"
base_url = "https://api.tryarcflow.com/v1"
env_key = "ARCFLOW_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='"arcflow"' \
--config 'model_providers.arcflow={ name="Arcflow", base_url="https://api.tryarcflow.com/v1", env_key="ARCFLOW_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.tryarcflow.com/v1"Quick verification
curl https://api.tryarcflow.com/v1/responses \
-H "Authorization: Bearer $ARCFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4","input":"Reply with ok"}'Sources: Codex advanced configuration and Codex environment variables.