Run GPT-5.6 in Claude Code with Claude Code Router

Run GPT-5.6 in Claude Code with a Claude Code router: Sol versus Fable 5 guide

Yes, you can run GPT-5.6 in Claude Code. OpenAI's GPT-5.6 Sol can drive the Claude Code harness once you add a Claude Code router, a small local proxy such as CLIProxyAPI or the tool literally named claude-code-router, that sits between the Claude Code CLI and the model provider and rewrites where requests go. Point Claude Code at the proxy with one environment variable and Sol takes over instead of a Claude model. This guide covers the two real ways to do it, a quick GPT-5.6 vs Fable 5 verdict, and the terms-of-service catch you should read before you touch it.

Key takeaways

  • A Claude Code router (CLIProxyAPI or claude-code-router) points Claude Code at a different backend by overriding ANTHROPIC_BASE_URL, so GPT-5.6 Sol, and even Grok 4.5 or Fable 5, can run as the main model.
  • There are two paths. The sanctioned one is OpenAI's official Codex plugin for Claude Code. The trending one is the CLIProxyAPI plus claudex alias route, which makes Sol the main model.
  • Setup is three moves: run the proxy (default port 8317), log in your Claude and Codex accounts, then set the proxy URL in ~/.claude/settings.json and add a claudex shell alias that picks the model.
  • Read this first: routing a Claude subscription OAuth token through a third-party proxy violates Anthropic's Consumer Terms, and Anthropic has blocked those tokens since early 2026. The proxy also holds both your Claude and Codex credentials.
  • For coding, Claude Fable 5 is the verified native option at $10 and $50 per million tokens. GPT-5.6 Sol lists cheaper at $5 and $30 per million tokens with a 1M-token context (per OpenRouter); its coding benchmarks are still vendor-reported, so treat those as directional.

What is a Claude Code router?

A Claude Code router is a local gateway that intercepts the requests Claude Code sends and forwards them to whatever model backend you choose. Claude Code is built to talk to Anthropic's API, but it reads an environment variable, ANTHROPIC_BASE_URL, that tells it where the API lives. Set that to a proxy running on your own machine and every request flows through the proxy, which can translate the call and hand it to a different provider. That single indirection is the whole trick behind running non-Anthropic models in an Anthropic-native tool.

Two projects dominate this space. claude-code-router (from developer musistudio) has existed since early 2025 and routes Claude Code, Codex, and other clients to many providers through a config file. CLIProxyAPI is the newer option that got the spotlight in July 2026: it exposes OpenAI, Claude, Codex, Gemini, and Grok compatible endpoints, logs in through each provider's OAuth flow, and balances across multiple accounts. Both do the same core job. This guide uses CLIProxyAPI for the main walkthrough because it is the one currently trending, and notes where claude-code-router differs.

GPT-5.6 Sol vs Claude Fable 5: the quick verdict

The honest short answer: for coding work inside Claude Code, Claude Fable 5 is the safer, better-documented pick today, and GPT-5.6 Sol is the newcomer worth testing if you specifically want OpenAI's reasoning style. The catch is transparency. Anthropic has published Fable 5's specifications and pricing in detail. GPT-5.6 Sol's pricing and context are now listed publicly too, at $5 and $30 per million tokens with a 1M-token context, per OpenRouter. Notice that Sol undercuts Fable 5 on price. Its coding benchmarks, though, are still vendor-reported, so we are not going to print a benchmark table that pretends otherwise.

Here is the GPT-5.6 vs Fable 5 picture: what is actually established versus what is reported.

Claude Fable 5 GPT-5.6 Sol
Vendor Anthropic OpenAI
Released June 9, 2026 (verified) July 9, 2026 (per OpenRouter)
Price per million tokens $10 in / $50 out (verified) $5 in / $30 out (per OpenRouter)
Model family Mythos-class, safe for general use Sol is the flagship above Terra and Luna
Native to Claude Code Yes, built for the harness No, needs a router or the Codex plugin
Effort control Reroutes sensitive prompts to Opus 4.8 on under 5% of sessions Reported effort levels including ultra and medium

Two details are worth calling out. First, Fable 5 is designed to run in an agent harness like Claude Code, working across long tasks, delegating to sub-agents, and checking its own output, per Anthropic's launch note. Second, one of the loudest early GPT-5.6 complaints, raised by developer Theo on X, is that setting Sol's effort to ultra cascades that setting to every sub-agent it spawns, which burns tokens fast. That is a user report, not documented OpenAI behavior, so verify it against your own runs. For a broader model-by-model coding comparison, see our best AI model for coding guide, and for Fable 5 specifically, our Claude Fable 5 review.

How to run GPT-5.6 in Claude Code

There are two supported ways to get GPT-5.6 into your Claude Code workflow, and they are not the same thing. One delegates specific tasks to Codex and is fully sanctioned. The other replaces the main model with Sol through a Claude Code router and lives in a gray area. Start with the sanctioned one.

Option 1: the sanctioned Codex plugin

OpenAI ships an official Codex plugin for Claude Code. It does not make Sol your main model; instead it lets Claude Code hand tasks to Codex for review or rescue, running on your normal Codex login. It is the lowest-risk way to put GPT-5.6 to work next to Claude. Install it from inside Claude Code:

/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup

That gives you commands like /codex:review, /codex:adversarial-review, and /codex:rescue. You can set the Codex model and reasoning effort in .codex/config.toml:

model = "gpt-5.6-sol"
model_reasoning_effort = "high"

Confirm the exact model string against your Codex account, since available model identifiers change as OpenAI updates the lineup.

Option 2: route GPT-5.6 Sol as your main model with CLIProxyAPI

This is the method that went viral: a Claude Code router that makes Sol the model behind every Claude Code turn. The shape is always the same. Run the proxy, authenticate your accounts, then point Claude Code at the proxy with a small set of environment variables, usually wrapped in a shell alias people call claudex. Read the risk section further down before you run this on a subscription account.

Step 1: install and start CLIProxyAPI. The quickest cross-platform option is the container, and the proxy listens on port 8317 by default. CLIProxyAPI also ships Homebrew and Linux packages, which are listed with their exact names in its documentation.

# Docker (maps the default 8317 port)
docker run --rm -p 8317:8317 \
  -v "$HOME/.cli-proxy-api":/root/.cli-proxy-api \
  eceasy/cli-proxy-api:latest

Step 2: log in your Claude and Codex accounts. CLIProxyAPI authenticates each provider through its own OAuth login and stores the credentials under ~/.cli-proxy-api, with settings in config.yaml. Follow the provider login flow in the CLIProxyAPI documentation rather than copying login commands from a blog, because those steps change between releases. This is the step that hands your tokens to the proxy, so it is the step the risk section is about.

Step 3: point Claude Code at the proxy. Put the connection details where Claude Code reads its environment config, in ~/.claude/settings.json. Use ANTHROPIC_BASE_URL for the proxy endpoint and ANTHROPIC_AUTH_TOKEN for the bearer token, which is the correct variable when you talk to a gateway rather than Anthropic's first-party API:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://your-proxy.example.com",
    "ANTHROPIC_AUTH_TOKEN": "your-proxy-token"
  }
}

Step 4: add the claudex alias. With the connection set in settings.json, the alias just selects the model and a few behavior flags for that one launch. A real-world claudex alias looks like this:

alias claudex='CLAUDE_CODE_SUBAGENT_MODEL=gpt-5.6-sol \
  CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 \
  CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=3 \
  ENABLE_TOOL_SEARCH=false \
  claude --model gpt-5.6-sol'

Line by line: claude --model gpt-5.6-sol launches Claude Code with Sol as the main model; CLAUDE_CODE_SUBAGENT_MODEL=gpt-5.6-sol makes spawned sub-agents use the same model; CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 turns on the model's effort controls; CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=3 caps concurrent tool calls at three; and ENABLE_TOOL_SEARCH=false disables dynamic tool search. Those variables apply only to that one launch, so plain claude still runs your normal Anthropic setup, and extra arguments pass straight through, so claudex --continue works as expected.

Claude Code v2.1.207 running gpt-5.6-sol, showing the claudex zsh alias and a plain-English breakdown of each variable
A real claudex alias: Claude Code is the harness, GPT-5.6 Sol is the model, set with CLAUDE_CODE_SUBAGENT_MODEL and claude –model gpt-5.6-sol.

One caveat worth repeating: copying the alias alone is not enough. The proxy from Step 1 has to understand Claude's API format and route gpt-5.6-sol to the right provider, so the base URL and token in settings.json are the part that actually makes the switch work.

The ~/.claude/settings.json env block with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN that points Claude Code at a GPT-5.6 proxy
The settings.json side: copying the alias alone is not enough, the proxy must understand the Claude API format and route gpt-5.6-sol to the right provider.

The claude-code-router alternative. If you prefer a config-file approach, claude-code-router does the same job through a local gateway, with routing rules that map roles (default, background, reasoning) to specific provider models. It predates CLIProxyAPI and supports OpenAI-compatible, Anthropic, Gemini, and OpenRouter backends. Check its documentation for the current install command and default port, then point Claude Code at it the same way. Pick whichever you find easier to keep configured.

Switching models mid-workflow. Because the router decides which backend a request hits, you can flip between providers by changing the model in your claudex alias (the --model flag), or the router's rule, and reconnecting: GPT-5.6 Sol for one task, Fable 5 for the next, Grok 4.5 for a cheap high-volume pass. That multi-vendor flexibility is the real reason people set these routers up.

Verify it works

Start a session through the alias and confirm the backend. If Claude Code starts and responds, the route is live; ask it to name the model it is running as a quick sanity check, and watch the proxy logs to see the request land.

claudex
# then, inside the session:
#   /status        shows the active model and endpoint
#   "which model are you?"   quick sanity check

The most common failure is a 401. It almost always means the wrong auth variable: use ANTHROPIC_AUTH_TOKEN (a bearer token) with a custom base URL, not ANTHROPIC_API_KEY, which sends Anthropic's first-party header format and will be rejected by the proxy.

Is this allowed, and is it safe?

This is the part the hype threads skip, and it matters more than the setup. The short version: the official Codex plugin is fine, but routing a Claude subscription OAuth token through a third-party proxy is not, and it carries real account and security risk.

Read this before you route a subscription token

  • It violates Anthropic's Consumer Terms. Since early 2026 Anthropic has blocked consumer OAuth tokens used outside Claude Code and Claude.ai, returning errors that state the credential is only authorized for use with Claude Code. Anthropic's position is that using those tokens in another tool is not permitted, per its legal and compliance docs. The token blocking has been widely reported, so this is enforced in practice, not just written into the terms.
  • The proxy holds both sets of credentials. CLIProxyAPI stores your Claude and your Codex OAuth logins in one place. A compromised or malicious build exposes both accounts at once. Running locally reduces, but does not remove, that trust requirement.
  • Prefer first-party keys. If you want GPT-5.6 in your workflow with far less risk, use the official Codex plugin, or drive the router with real, paid API keys from each vendor instead of subscription OAuth tokens. API keys are meant to be used programmatically; subscription login tokens are not.

None of this means the tooling is malware. CLIProxyAPI and claude-code-router are open-source projects that many developers run happily. It means the specific move of funneling a consumer subscription token through them is the part that breaks the rules and concentrates risk. Decide with that in mind, especially on an account you cannot afford to lose.

Which should you use?

Match the tool to your appetite for risk and the job in front of you. If you want to try GPT-5.6 Sol's reasoning style inside Claude Code with the least friction and no terms-of-service worry, install the official Codex plugin and delegate to it. If you want Sol as your main driver and you are using proper API keys, a Claude Code router like CLIProxyAPI or claude-code-router is a clean, flexible setup that also lets you swap in Grok 4.5 or Fable 5 per task. If you simply want the strongest coding model that is native to the harness with no proxy at all, stay on a Claude model: Fable 5 for the hardest work, Opus 4.8 as the balanced default, which we cover in our Claude Opus 4.8 review.

Whichever model generates the code, the bottleneck moves to review. Faster generation from any vendor means more output to check, and a model that confidently calls its own code safe can still be wrong, a point we go into in the security risks of vibe coding. If you want help choosing and operating the right models for your stack, that is exactly the work we do when teams hire AI developers through Valletta.

Frequently asked questions

Can you really run GPT-5.6 in Claude Code?

Yes. Claude Code reads the ANTHROPIC_BASE_URL environment variable, so a local proxy called a Claude Code router (CLIProxyAPI or claude-code-router) can intercept its requests and forward them to GPT-5.6 Sol. You can also use OpenAI's official Codex plugin to delegate tasks to Sol without replacing the main model.

What is a Claude Code router?

It is a local gateway that sits between the Claude Code CLI and the model provider. By overriding the API endpoint Claude Code points at, it can route your requests to OpenAI, xAI, Google, or other backends, and switch between them per task. CLIProxyAPI and claude-code-router are the two common ones.

Is CLIProxyAPI or the claudex setup safe?

The software is open source and widely used, but the setup asks you to store your Claude and Codex OAuth credentials in one proxy, and routing a Claude subscription token through it violates Anthropic's Consumer Terms. Anthropic has blocked such tokens since early 2026. The lower-risk paths are the official Codex plugin or driving the router with first-party API keys.

Is GPT-5.6 Sol better than Claude Fable 5 for coding?

There is no verified answer yet. Fable 5's specifications and $10 and $50 per million token pricing are published by Anthropic. GPT-5.6 Sol lists cheaper at $5 and $30 per million tokens with a 1M-token context (per OpenRouter), but its coding benchmarks remain vendor-reported and not independently confirmed. For Claude Code specifically, Fable 5 is native and better documented today, so treat Sol as a promising option to test rather than a proven upgrade.

Does routing a Claude subscription token break the terms of service?

Yes. Anthropic states that consumer OAuth tokens are authorized only for Claude Code and Claude.ai, and using them in another tool is not permitted. Since early 2026 it has actively blocked tokens used outside those products, so there is a real risk to the account. Using a paid API key instead avoids that specific problem.

Can you switch between Anthropic and OpenAI models mid-session?

With a router, yes, at the level of restarting the session. Because the router chooses the backend, you change the model variable or routing rule and reconnect to move between GPT-5.6 Sol, Fable 5, and Grok 4.5. Many teams set this up precisely to route cheap work and hard work to different vendors.

Valletta.Software - Top-Rated Agency on 50Pros

Your way to excellence starts here

Start a smooth experience with Valletta's staff augmentation