Codex CLI.
One provider block.
Codex CLI reads its provider from a configuration file. BeefAPI is added as a named provider that points at the OpenAI-compatible Base URL.
CONFIG.TOML · WIRE API · RESPONSES
CODEX CLI SETUP
BEEFAPICLIENT GUIDE
How do I configure Codex CLI to use BeefAPI?
Before you start
- Install Codex CLI.
- Create a global key in API keys and add USD credit in Billing.
- Check which models your key serves before you write one into the file.
The provider block
~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml)
model_provider = "beefapi"
model = "gpt-5.6-sol"
[model_providers.beefapi]
name = "BeefAPI"
base_url = "https://global.beefapi.com/v1"
wire_api = "responses"
env_key = "BEEFAPI_KEY"
supports_websockets = falseExport the variable named by env_key, then restart the CLI
export BEEFAPI_KEY="sk-..."Read the fields literally
base_urlincludes/v1. This is the OpenAI-compatible Base URL, not the host root.wire_apiisresponses. Current Codex configuration supports the Responses API here, so an older example that sets a chat wire API is not a working configuration.env_keynames the environment variable that holds the key. The key itself is not written into the file.supports_websocketsisfalse, so the client uses plain HTTP instead of a websocket transport.- Restart the CLI after editing the file; a running session keeps the configuration it started with.
Confirm the gateway path
Send one message. The check has two halves: a successful response in Codex, and the matching entry in the Usage log. If Codex reports that the provider is unknown, the block was not read, so check the file location and the exact model_providers table name.
- Model rejected: the provider is reachable but the model ID is not available to this key. Replace
modelwith an ID fromGET /v1/models. - No record at all is not proof that nothing was sent. Re-check the time window and the key, then look the call up by its request ID and read the client error before changing configuration.
Codex CLI provider fields follow OpenAI's own configuration reference, and that reference can change. The block above gives the BeefAPI-side values for the fields Codex currently documents, so re-check the official reference when you upgrade Codex. BeefAPI does not control Codex CLI flags, defaults or release behaviour.
Still deciding
Codex works but the model name is rejected. Why?
The provider is reachable but the model ID is not available to that key. Replace model with an ID that GET /v1/models returns for the same key, and check the price list for current IDs.
Should base_url include /v1?
Yes for Codex CLI, because it is an OpenAI-compatible client. The Anthropic-compatible path is different: Claude Code uses the host root with no /v1.
Sources
- BeefAPI docs · Client setup checked 2026-09-26
- OpenAI · Codex configuration reference checked 2026-09-26
Page facts checked 2026-09-26. Prices, model IDs and client configurations change; the linked sources are authoritative.