Configure Codex CLI
Point Codex CLI at StoryClaw's OpenAI Responses endpoint, either by writing a config file or through the CC Switch GUI.
Codex talks to OpenAI by default. Switching it to StoryClaw takes two things: a provider block, and your key in an environment variable.
If Codex is not installed yet, start with Install Codex CLI. Create your key on the API Keys page of the console — see API Keys. Pick either option below; the result is identical.
Codex speaks the Responses protocol, so only GPT models work — see Available models. Claude, DeepSeek, Kimi, and similar models cannot be used in Codex; use them in Claude Code instead.
Option A: manual setup
Write the following into ~/.codex/config.toml (create the file if it does not exist):
model_provider = "storyclaw"
model = "gpt-5.6-sol"
[model_providers.storyclaw]
name = "StoryClaw"
base_url = "https://llm.storyclaw.com/v1"
env_key = "STORYCLAW_API_KEY"
wire_api = "responses"
disable_response_storage = trueA few things in this block are easy to get wrong:
storyclawis a name you choose, butmodel_provider = "storyclaw"and[model_providers.storyclaw]must use the same word — rename both together. Avoidopenai,ollama, andlmstudio; those are reserved in Codex.env_keyholds the name of an environment variable, not the key itself — the key is set separately in the next step and never appears in this file.base_urlmust include/v1. Codex appends/responsesto it.disable_response_storage = trueis required. StoryClaw does not store responses, so without it Codex tries to continue conversations withprevious_response_idand fails.modeltakes a single value — the default model. Available IDs are in Available models. Pass--modelat launch to use a different one.
On macOS and Linux, one command writes the whole file:
The command below overwrites ~/.codex/config.toml entirely — any other providers, MCP servers, and settings in it are lost. If the file already exists, back it up first (cp ~/.codex/config.toml ~/.codex/config.toml.bak) or append the block by hand as shown above.
mkdir -p ~/.codex && cat > ~/.codex/config.toml <<'EOF'
model_provider = "storyclaw"
model = "gpt-5.6-sol"
[model_providers.storyclaw]
name = "StoryClaw"
base_url = "https://llm.storyclaw.com/v1"
env_key = "STORYCLAW_API_KEY"
wire_api = "responses"
disable_response_storage = true
EOFThen put the key in an environment variable:
# macOS / Linux — add to ~/.zshrc or ~/.bashrc to persist
export STORYCLAW_API_KEY="your-storyclaw-key"# Windows (PowerShell) — reopen the terminal afterwards
setx STORYCLAW_API_KEY "your-storyclaw-key"model_provider and model_providers only take effect in the user-level ~/.codex/config.toml. Codex ignores them in a project-level .codex/config.toml.
Option B: the CC Switch GUI
CC Switch is an open-source provider manager that configures the same thing through a GUI, with no TOML to write. It writes the settings into ~/.codex/config.toml, so the result is the same as Option A. On macOS, brew install --cask cc-switch is all it takes; other platforms are covered in CC Switch.
Add a provider
Launch CC Switch, switch to the Codex tab at the top, and click the + button in the upper right.

Fill in the settings
In the "Add new provider" dialog, click Custom configuration and start with the basics below.

| Field | Value | Notes |
|---|---|---|
| Provider name | StoryClaw-Codex | Anything you like — it is just a label |
| Website | https://storyclaw.com | Optional |
| API Key | Your StoryClaw API key | From the API keys page in the console |
| API endpoint | https://llm.storyclaw.com/v1 | No trailing slash; leave the Full URL toggle beside the label off |
| Default model | gpt-5.6-sol | If left blank with model mapping configured, the first mapped row is used |
| Upstream format | Responses (native) | Under Advanced options. StoryClaw is a native Responses API, so this connects directly with no format translation |
Stop the endpoint at /v1 and leave the Full URL toggle next to it off — Codex appends /responses itself. With the toggle on, /v1 is treated as the complete address and requests fail with 404.
Then expand Advanced options at the bottom of the form:

| Option | Notes |
|---|---|
| Local route mapping | Leave it off. StoryClaw supports the Responses protocol natively, so Codex connects directly and needs no local translation. |
| Reasoning effort support | Optional. When enabled, Codex's reasoning.effort (low / medium / high) is converted into the matching upstream parameters. Useful when you want to control the reasoning budget. |
Model mapping, just below the advanced options, decides which models the /model command in Codex and the model dropdown in the desktop app can see. Fill it in three steps:
- Click Fetch model list to pull the available models using the endpoint and key you just entered.
- Click Add model to add a row to the table.
- Click the dropdown arrow on that row and pick a model from the fetched list. You can also type one by hand — the Actual request model column must match Available models.
Repeat steps 2 and 3 for each model you want. Restart Codex afterwards for the list to refresh.
Finally, scroll on to the config.toml (TOML) block — it shows exactly what CC Switch will write. Tick Apply shared configuration in its upper right so the settings land in the global ~/.codex/config.toml and apply to every project, then click Add in the lower right.
CC Switch writes the settings — the key included — into ~/.codex/config.toml, so no files need editing by hand and the environment-variable step from Option A is unnecessary.
Enable the provider
Back in the provider list, hover the StoryClaw-Codex row and click the Enable button on its right. A highlighted row means it is active.
Verify the setup
Restart your terminal first — Codex reads environment variables at startup. Then go to any project directory:
codex
The startup screen shows the model in use. Send any message and a normal reply means the connection works.

Using the Codex desktop app? The same configuration applies immediately — see Codex desktop.
Available models
Codex speaks the OpenAI Responses protocol; it dropped Chat Completions support in February 2026. StoryClaw currently exposes three GPT models over Responses:
| Model ID | Notes |
|---|---|
gpt-5.6-sol | Balanced general capability |
gpt-5.6-luna | Faster responses |
gpt-5.6-terra | Geared toward complex work |
Check the current list any time:
curl https://llm.storyclaw.com/v1/models \
-H "Authorization: Bearer YOUR_KEY"Models that come back with a responses_api_url field are the ones Codex can use directly.
Choosing a model
Switch models with /model during a session, or set one at launch:
codex --model gpt-5.6-lunaCommon adjustments
| Goal | How |
|---|---|
| Change reasoning effort | Add model_reasoning_effort = "high"; accepts minimal, low, medium, high |
| Keep several configurations | Save as ~/.codex/<name>.config.toml and launch with codex --profile <name> |
| Long replies cut off mid-stream | Add stream_idle_timeout_ms = 600000 to the provider block (default 300000) |
Troubleshooting
| Symptom | Fix |
|---|---|
POST /v1/responses is not supported for model | That model does not support the Responses protocol and cannot be used in Codex. Switch to a GPT model. |
Unknown model | The model ID is wrong. Run curl https://llm.storyclaw.com/v1/models to check the exact spelling. |
| Errors start on the second turn of a conversation | disable_response_storage = true is missing. StoryClaw does not store responses, so Codex's previous_response_id follow-up fails. |
401 / authentication error | The key is unset or invalid. Check with echo $STORYCLAW_API_KEY (echo $env:STORYCLAW_API_KEY in PowerShell), then restart the terminal. |
Error saying wire_api = "chat" is no longer supported | Codex removed Chat Completions support. Change the setting to wire_api = "responses". |
| Configuration changes have no effect | The terminal was not restarted, or the settings went into a project-level .codex/config.toml — model_provider and model_providers are read only from the user-level ~/.codex/config.toml. |
| Requests still go to OpenAI | The model_provider value does not match the name in [model_providers.…]. |
404 on Option B | The endpoint carries an extra path, or the Full URL toggle was left on. Stop the address at https://llm.storyclaw.com/v1 and keep the toggle off. |
| Option B settings never reach the global config | Apply shared configuration is unticked in the config.toml (TOML) block on the provider's edit page. |
For install problems or a missing codex command, see Install Codex CLI.