StoryClaw Docs

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):

~/.codex/config.toml
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

A few things in this block are easy to get wrong:

  • storyclaw is a name you choose, but model_provider = "storyclaw" and [model_providers.storyclaw] must use the same word — rename both together. Avoid openai, ollama, and lmstudio; those are reserved in Codex.
  • env_key holds 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_url must include /v1. Codex appends /responses to it.
  • disable_response_storage = true is required. StoryClaw does not store responses, so without it Codex tries to continue conversations with previous_response_id and fails.
  • model takes a single value — the default model. Available IDs are in Available models. Pass --model at 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
EOF

Then 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.

Click the Codex tab and 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.

Choose custom configuration and fill in the form

FieldValueNotes
Provider nameStoryClaw-CodexAnything you like — it is just a label
Websitehttps://storyclaw.comOptional
API KeyYour StoryClaw API keyFrom the API keys page in the console
API endpointhttps://llm.storyclaw.com/v1No trailing slash; leave the Full URL toggle beside the label off
Default modelgpt-5.6-solIf left blank with model mapping configured, the first mapped row is used
Upstream formatResponses (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:

CC Switch advanced options panel

OptionNotes
Local route mappingLeave it off. StoryClaw supports the Responses protocol natively, so Codex connects directly and needs no local translation.
Reasoning effort supportOptional. 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:

  1. Click Fetch model list to pull the available models using the endpoint and key you just entered.
  2. Click Add model to add a row to the table.
  3. 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

Starting codex in a terminal

The startup screen shows the model in use. Send any message and a normal reply means the connection works.

Codex replying normally after startup

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 IDNotes
gpt-5.6-solBalanced general capability
gpt-5.6-lunaFaster responses
gpt-5.6-terraGeared 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-luna

Common adjustments

GoalHow
Change reasoning effortAdd model_reasoning_effort = "high"; accepts minimal, low, medium, high
Keep several configurationsSave as ~/.codex/<name>.config.toml and launch with codex --profile <name>
Long replies cut off mid-streamAdd stream_idle_timeout_ms = 600000 to the provider block (default 300000)

Troubleshooting

SymptomFix
POST /v1/responses is not supported for modelThat model does not support the Responses protocol and cannot be used in Codex. Switch to a GPT model.
Unknown modelThe 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 conversationdisable_response_storage = true is missing. StoryClaw does not store responses, so Codex's previous_response_id follow-up fails.
401 / authentication errorThe 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 supportedCodex removed Chat Completions support. Change the setting to wire_api = "responses".
Configuration changes have no effectThe terminal was not restarted, or the settings went into a project-level .codex/config.tomlmodel_provider and model_providers are read only from the user-level ~/.codex/config.toml.
Requests still go to OpenAIThe model_provider value does not match the name in [model_providers.…].
404 on Option BThe 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 configApply 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.

On this page