Codex
A Codex custom provider uses the Responses API. Select a Flex247 model that supports /v1/responses.
1. Set the API key
Windows PowerShell
powershell
$env:FLEX247_API_KEY = "sk-your-flex247-key"macOS / Linux
bash
export FLEX247_API_KEY="sk-your-flex247-key"2. Edit config.toml
User-level configuration is stored at:
- Windows:
%USERPROFILE%\.codex\config.toml - macOS / Linux:
~/.codex/config.toml
Add:
toml
model = "your-responses-model-id"
model_provider = "flex247"
model_reasoning_effort = "medium"
[model_providers.flex247]
name = "Flex247"
base_url = "https://api.noflex.work/v1"
env_key = "FLEX247_API_KEY"
wire_api = "responses"Model requirement
Codex custom providers currently use responses as the wire API. Use a Responses-compatible model from Model Square.
3. Start and verify
From a test project directory, run:
bash
codexAsk Codex to list the current directory without modifying files, then confirm the request in Flex247 Usage Logs.
Troubleshooting
Missing environment variable
Set FLEX247_API_KEY in the same terminal that launches Codex.
404 or Responses error
Verify base_url = "https://api.noflex.work/v1" and select a Responses-compatible model.
Configuration does not apply
Provider, authentication and Base URL settings belong in user-level config.toml, not only in a project .codex/config.toml.