Codex CLI and CC Switch on Ofox: The Two-Protocol Setup

CC Switch sets up Codex CLI and Claude Code against Ofox from one place. The two need different base URLs and API formats — mixing them up is the usual failure.

Codex CLI and CC Switch on Ofox: The Two-Protocol Setup

Codex CLI and Claude Code speak different protocols. CC Switch keeps both entries side by side, which is the main reason to use it — pasting the Claude Code base URL into the Codex tab, or the reverse, is an easy mistake to make by hand.

Two clients, two protocols

Codex CLIClaude Code
ProtocolOpenAI-compatibleAnthropic native
Ofox base URLhttps://api.ofox.ai/v1https://api.ofox.ai/anthropic
API format in CC SwitchOpenAI CompatibleAnthropic Messages (Native)
Auth fieldnot applicableANTHROPIC_AUTH_TOKEN (Default)
CC Switch tabCodex(provider management page)

Neither URL takes a trailing slash, and one Ofox key authenticates both. Note that this table describes the client, not the model — all three Claude models in the Ofox catalog accept either protocol.

Installing CC Switch

# macOS
brew install --cask cc-switch

# Debian / Ubuntu — download the .deb from Releases first
sudo dpkg -i <downloaded-file>.deb

# Fedora / RHEL
sudo rpm -i <downloaded-file>.rpm

# AppImage
chmod +x <downloaded-file>.AppImage && ./<downloaded-file>.AppImage

Windows ships an .msi installer, and macOS has a .dmg on the releases page if you would rather not use Homebrew. For the full install walkthrough, see the CC Switch setup guide. Minimum supported versions are macOS 12, Windows 10, and Ubuntu 22.04 / Debian 11 / Fedora 34.

Adding the Codex CLI provider

Switch to the Codex tab at the top, then use the + button in the top-right corner.

FieldValue
Provider Nameofoxai-codex
Website URLhttps://ofox.ai
API Keyyour Ofox key
Request URLhttps://api.ofox.ai/v1
API FormatOpenAI Compatible
Write to Global Configchecked

Leaving “Write to Global Config” checked applies the provider across all projects rather than just the current one. Add the provider, then activate it from the list.

Adding the Claude Code provider

Same tool, different page and different values.

FieldValue
Provider Nameofoxai-claude
Website URLhttps://ofox.ai
API Keyyour Ofox key
Request URLhttps://api.ofox.ai/anthropic
API Format / Auth FieldAnthropic Messages (Native) / ANTHROPIC_AUTH_TOKEN (Default)
Model Configurationleave empty
Write to Global Configchecked

Leave Model Configuration empty. It falls through to the default Claude model, which is what you want unless you are deliberately pinning one. CC Switch writes the result to ~/.claude/settings.json.

There are two optional toggles on this page, “Hide AI Signature” and “Teammates Mode”. Neither affects routing or billing.

Turning on usage query

CC Switch can poll Ofox for consumption figures and show them in its dashboard. Four things to set: toggle Enable Usage Query on, paste the same Ofox API key, set the request endpoint to https://api.ofox.ai/v1, and pick the Universal Template (通用模板) option, which the Ofox documentation recommends for best compatibility.

Two things to know:

  • It does not consume API quota — it uses a dedicated statistics API rather than your call budget.
  • Figures lag the calls that produced them by a few minutes.

Turning it off later does not disturb normal API calls.

On Fable 5.1 specifically

You cannot route Fable 5.1 through this setup today. As of 3 September 2026 the Ofox catalog carries 138 models, and the only Fable entry is anthropic/claude-fable-5. No base URL, provider name, or model string changes that.

The setup is worth doing now regardless: it gives you a working two-protocol path where switching models is a string change. The catalog has anthropic/claude-fable-5, anthropic/claude-opus-5 and anthropic/claude-sonnet-5 at Anthropic list prices with no markup, and all three are reachable over either protocol on the same key.

That is worth doing ahead of Fable 5.1 in particular, because its only price change is the cache read — $1 down to $0.25. Whether that is worth anything to you depends entirely on your cache-hit ratio, and the way to find out is to run your real workload on Fable 5 now and read the number off your own usage. The API reference has the rate table and the TTL arithmetic.

When something does not connect

Three common failure modes:

  • A trailing slash on the request URL. The Ofox documentation calls this out for both providers.
  • The wrong API format for the tab. Codex CLI with “Anthropic Messages (Native)” selected will not work, and neither will the reverse. Check the format field before the key.
  • A model string the catalog does not have. anthropic/claude-fable-5-1 is currently in this category. The live catalog is the authority — GET /v1/models returns exactly what you can call.

CC Switch installation targets, provider field values, base URLs and usage-query behaviour verified against the Ofox integration documentation on 3 September 2026. Catalog contents checked against the live /v1/models endpoint the same day.

Frequently Asked Questions

What is CC Switch?
An open-source provider manager with a visual interface. It writes the config files for Claude Code and Codex CLI, so you do not have to edit JSON or environment variables by hand. For Claude Code it writes ~/.claude/settings.json. It runs on macOS 12+, Windows 10+, and Ubuntu 22.04+ / Debian 11+ / Fedora 34+.
Do Codex CLI and Claude Code use the same Ofox base URL?
No — and this is where setups usually go wrong. Codex CLI is an OpenAI-protocol client and takes https://api.ofox.ai/v1 with the API format set to OpenAI Compatible. Claude Code is an Anthropic-protocol client and takes https://api.ofox.ai/anthropic with the format set to Anthropic Messages (Native). Neither URL takes a trailing slash.
Can I run Claude Fable 5.1 through this setup?
Not yet. As of 3 September 2026 the Ofox catalog has 138 models and no Fable 5.1 entry. The configuration below is correct and works today for the models that are in the catalog, including Fable 5, Opus 5 and Sonnet 5. If and when 5.1 is added, nothing in the setup should change — only the model string.
Does CC Switch's usage query burn API quota?
No. Per the Ofox integration documentation it uses a dedicated statistics API and does not count against your API call limits. Usage figures typically appear within a few minutes of the calls that produced them.
Can I keep more than one Ofox account in CC Switch?
Yes. You can add multiple Ofox provider entries with different API keys and switch between them from the list.