Use Codex CLI with BazaarLink: config.toml setup and a real /v1/responses run
Point Codex CLI's Responses API connection at BazaarLink, then check the setup with one command.
Tested with Codex CLI 0.160.0 and openai/gpt-5.4-mini on 2026-10-05. Model names can change; check the models page.
Before you begin
You need Codex CLI and a BazaarLink API key. These examples put the key in an environment variable, outside config.toml.
1. Get an API key and set the environment variable
After getting a BazaarLink API key, set BAZAARLINK_API_KEY in the terminal where you run Codex CLI. Replace the placeholder with your own key.
macOS / Linux
export BAZAARLINK_API_KEY="YOUR_BAZAARLINK_API_KEY"Windows PowerShell
$env:BAZAARLINK_API_KEY = "YOUR_BAZAARLINK_API_KEY"2. Edit ~/.codex/config.toml
On Windows, the path is %USERPROFILE%\.codex\config.toml. Add these settings to the file; if it already exists, update the same fields.
3. Run your first command
Run the command below in your terminal. This is the command used in the 2026-10-05 test.
codex exec --skip-git-repo-check "Reply with exactly one line: hello from BazaarLink"Observed output excerpt
provider: bazaarlink
model: openai/gpt-5.4-mini
hello from BazaarLink
tokens usedThe tested run showed provider and model in the header, answered with one line, hello from BazaarLink, and ended with tokens used. Even for this short prompt, Codex sent its own system instructions and tool definitions; this run used about 10k tokens.
In this test, the model issued a shell function call. Codex executed or blocked it locally, sent back the result, and the model answered. This verified the /v1/responses function_call round trip; it does not establish that every Codex feature works.
4. Change the model
The model value in config.toml can be replaced with any model listed on the models page (/models).
Replace the model value in config.toml with an available model ID from the models page or GET /v1/models. A model not enabled for your key or route may return 503; choose another model ID.
5. Questions and troubleshooting
Model metadata warning
Codex may show `Model metadata for openai/gpt-5.4-mini not found. Defaulting to fallback metadata` and `reasoning effort: none` in the header. The tested run showed this harmless warning.
HTTP 503: model unavailable
If you see `Service unavailable for this model. Please try a different model or contact support.`, that model is not enabled for the current key or route. Choose another model ID from the models page or GET /v1/models.
401 or key setup
Check that BAZAARLINK_API_KEY is set in the terminal running Codex CLI and that config.toml uses the same env_key spelling.
Which base_url should I use?
Use https://api.bazaarlink.ai/v1. The alternative https://bazaarlink.ai/api/v1 is also supported.
FAQ
Does the API key go in config.toml?
No. The example uses env_key to read the BAZAARLINK_API_KEY environment variable.
Do I need to fix the model metadata warning?
The test with openai/gpt-5.4-mini showed a fallback metadata warning, which can be ignored.
What if the model returns 503?
Choose another model ID available for your key or route from the models page or GET /v1/models.