Back
Kevin Riedl

11 min read Β· 26 Jul 2026

Next

Claudex: run GPT-5.6 Sol inside Claude Code with CLIProxyAPI

Yes, you can use GPT-5.6 Sol as the model inside the Claude Code CLI. Claude Code remains the agent harness that reads the repository, plans work, calls tools and coordinates subagents. A local gateway called CLIProxyAPI translates the Anthropic Messages request and sends it to OpenAI through your Codex login. The community calls the combination Claudex.

The popular four-line alias is not the setup. It only selects a model after the gateway is already installed, authenticated and connected. Without ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, plain Claude Code has no reason to send traffic to CLIProxyAPI.

This guide gives you the missing connection, a safer localhost configuration, a test at each boundary and an alias you can remove without changing normal claude sessions. Facts and commands were checked on 26 July 2026.

What Claudex is, and what it is not

LayerWhat runs thereWho maintains it
Agent harnessClaude Code CLI, tools, permissions, memory and subagentsAnthropic
Protocol bridgeCLIProxyAPI on your machine, usually port 8317Independent open-source project
Modelgpt-5.6-solOpenAI
AuthenticationCodex OAuth stored locally by the proxy, plus your own proxy client keyYou

CLIProxyAPI describes itself as an API service compatible with OpenAI, Gemini, Claude and Codex protocols. Its source code is available on GitHub, but it is not an Anthropic or OpenAI product. Anthropic's gateway documentation says compatible gateways can connect to Claude Code, while also stating that Anthropic does not support routing Claude Code to non-Claude models. That distinction matters: the mechanism is possible, but this exact model pairing is unsupported by Anthropic.

This article targets implementation intent. If you are deciding between products, use our separate Claude Code vs OpenCode team-cost comparison. If you are choosing a production gateway, use the LLM gateway comparison. Keeping those questions separate prevents a setup tutorial from pretending to be a procurement framework.

The two-minute claim, honestly

If Homebrew, Claude Code and an eligible Codex account are ready, the happy-path commands take a few minutes. The first secure setup can take longer because you should inspect the config, generate a client key, finish browser OAuth and verify the model list. Do not trade those checks for a faster screenshot.

Step 1: install and start CLIProxyAPI on macOS

brew install cliproxyapi
brew services start cliproxyapi

These are the current commands in the CLIProxyAPI quick start. Homebrew normally uses $(brew --prefix)/etc/cliproxyapi.conf. Check the active path before editing a different copy.

Step 2: bind the proxy to localhost and set a real client key

The project's example config uses an empty host, which binds all IPv4 and IPv6 interfaces. For a personal local proxy holding OAuth credentials, restrict it to 127.0.0.1. Set a random client key under api-keys and leave remote management off:

host: "127.0.0.1"
port: 8317

remote-management:
  allow-remote: false
  secret-key: ""

api-keys:
  - "claudex-REPLACE-WITH-A-LONG-RANDOM-SECRET"

Generate the value locally with openssl rand -hex 32, place the result after a memorable prefix and do not paste it into a repository, issue or screenshot. The official configuration reference documents the listen address, port, authentication directory and API-key list.

brew services restart cliproxyapi

Step 3: connect your Codex account

cliproxyapi --codex-login

A browser opens for OpenAI authentication. On a headless machine, the project's Codex OAuth guide documents --no-browser and a local callback on port 1455. Use the OpenAI workspace whose Codex allowance you intend to consume.

OAuth credentials are sensitive. CLIProxyAPI stores authentication material under its configured auth directory, commonly ~/.cli-proxy-api. Keep that directory out of source control, protect the machine account and update the proxy promptly. Before using any subscription through a third-party client, check the current plan rules and provider terms yourself.

Step 4: verify the proxy before opening Claude Code

Replace the placeholder with the client key you configured:

curl -sS http://127.0.0.1:8317/v1/models \
  -H "Authorization: Bearer claudex-REPLACE-WITH-A-LONG-RANDOM-SECRET"

Do not continue until the JSON contains gpt-5.6-sol. OpenAI lists that exact model ID, a 1.05 million token context window, 128,000 maximum output tokens and reasoning levels from none through max on the GPT-5.6 Sol model page. Account access can still vary by plan and rollout. OpenAI's current help page lists Codex CLI 0.144.0 as the minimum version for GPT-5.6 access.

If the endpoint returns 401, the client key and api-keys entry do not match. If the model is absent, update CLIProxyAPI, confirm the OAuth account and check that the model is available in native Codex first. An alias cannot create provider access.

Step 5: add the complete Claudex alias

Add this to ~/.zshrc, substitute your key, then open a new shell:

alias claudex='ANTHROPIC_BASE_URL=http://127.0.0.1:8317 \
ANTHROPIC_AUTH_TOKEN=claudex-REPLACE-WITH-A-LONG-RANDOM-SECRET \
CLAUDE_CODE_SUBAGENT_MODEL=gpt-5.6-sol \
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=3 \
ENABLE_TOOL_SEARCH=auto:5 \
claude --model gpt-5.6-sol'

Run claudex, send a trivial prompt, then run /status. Claude Code's gateway connection guide says the status view should show the custom Anthropic base URL and the active auth-token source. That proves the session inherited the gateway settings. Plain claude remains unchanged because the variables are scoped to the alias.

Why this alias differs from the viral version

VariableKeep?Reason
ANTHROPIC_BASE_URLYesActually routes Claude Code to the local gateway.
ANTHROPIC_AUTH_TOKENYesAuthenticates the client to your proxy. This is not your OpenAI OAuth token.
CLAUDE_CODE_SUBAGENT_MODELUsuallyOfficial Claude Code docs give it first priority when selecting a subagent model.
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=3OptionalReduces the default concurrency of 10. Useful for rate limits, but potentially slower.
ENABLE_TOOL_SEARCH=falseNo by defaultLoads every tool definition into the context on every turn.
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1ExperimentalIt is not in Anthropic's public environment-variable reference. Do not build a stable team workflow around it.

Claude Code's current tool-search documentation says tool search is on by default, but normally falls back to eager loading when ANTHROPIC_BASE_URL points to a third-party host. Setting auto:5 explicitly enables deferred discovery when tool definitions exceed five percent of context. Use true to force it. Use false only when CLIProxyAPI rejects the required beta header or tool_reference blocks. A smaller prompt is useful only if the proxy supports the protocol feature.

How to set reasoning effort without relying on a hidden flag

GPT-5.6 Sol supports none, low, medium, high, xhigh and max. CLIProxyAPI officially supports effort suffixes such as gpt-5.6-sol(high) and translates them to OpenAI reasoning parameters. Start with medium or high, then measure accepted-task cost. More reasoning can use more allowance, take longer and trigger more tool work.

claude --model 'gpt-5.6-sol(high)'

Before changing a team default, read our cost per token vs cost per completed task analysis. The cheapest or deepest individual call is not automatically the cheapest accepted change.

Does GPT-5.6 Sol become better because it runs in Claude Code?

The model does not change. The harness does.

Claude Code chooses what repository context to read, how to expose tools, when to delegate, how permissions work and how results return to the conversation. GPT-5.6 Sol supplies the decisions and generated output inside that loop. Developers may prefer the combination because they prefer Claude Code's orchestration, not because the proxy improves OpenAI's model weights.

OpenAI calls GPT-5.6 Sol its frontier model for complex professional work and coding. Claude Code documents subagents, worktrees, hooks, skills and model routing. Combining those capabilities can be productive, but anecdotes are not a controlled benchmark. Compare native Codex, native Claude Code and Claudex on the same repository commit, acceptance tests, effort, permissions and review bar. Our Claude Fable coding playbook covers the alternative where Claude remains the orchestrator and judgment model.

Troubleshooting Claudex

Claude Code still uses Claude

Run /status. If the base URL is absent, the alias was not loaded. Run source ~/.zshrc or open a new terminal. Check for a settings-file value overriding the shell variable.

401 Unauthorized

Match ANTHROPIC_AUTH_TOKEN to an entry under CLIProxyAPI's api-keys. It is a local client credential, not the Codex OAuth token stored by the proxy.

Unknown provider or unknown model

Query /v1/models first. Use the exact returned ID. Update the proxy and re-run Codex OAuth if native Codex has the model but the proxy does not.

Tool search returns a 400 error

Change ENABLE_TOOL_SEARCH=auto:5 to false. That sacrifices context efficiency but avoids sending unsupported tool-reference shapes. Re-test after a CLIProxyAPI update.

Compaction happens at the wrong time

Claude Code may infer context limits from the model name. Its environment reference documents CLAUDE_CODE_MAX_CONTEXT_TOKENS, but only when DISABLE_COMPACT is also set. Avoid disabling compaction casually. Monitor /context, clear unrelated work and verify behavior with a disposable session before changing context assumptions.

When Claudex is the right choice

  • You want a reversible personal comparison of the Claude Code and Codex harnesses.
  • You already understand local OAuth storage and proxy maintenance.
  • You can verify output with tests, diffs and human review.
  • You accept that Anthropic does not support non-Claude models through the gateway.

When not to use this setup

  • You need vendor support for the full client-to-model path.
  • You are handling customer code, regulated data or company secrets without approved data-flow and access controls.
  • You need centralized revocation, audit logs, per-user attribution, budgets and an incident owner.
  • Your team assumes a ChatGPT subscription proxy is equivalent to a production API contract.

For team use, move beyond a shell alias. Anthropic recommends a gateway credential per developer, centralized configuration and secrets tooling. Add version pinning, model allowlists, spend limits, logs with redaction, update ownership and a rollback path. If you need that operating model rather than a weekend experiment, Wavect's AI enablement and architecture service can design the gateway, evaluation and governance layer with your team.

Need a secure multi-model coding workflow for your team?

 Scope the AI enablement setup

Primary sources and freshness boundary

Checked on 26 July 2026. Model access, Claude Code flags and proxy behavior change quickly. Re-check the OpenAI GPT-5.6 Sol model page, OpenAI GPT-5.6 availability guidance, Claude Code gateway connection guide, Claude Code environment-variable reference, CLIProxyAPI quick start, Codex OAuth guide and CLIProxyAPI effort translation before relying on the commands.

Frequently Asked Questions

Can Claude Code run GPT-5.6 Sol?
Yes, through an Anthropic-compatible gateway such as CLIProxyAPI. Claude Code remains the client and agent harness, while the gateway translates requests and routes them to GPT-5.6 Sol. Anthropic does not support routing Claude Code to non-Claude models, so treat the combination as an unofficial integration.
What is Claudex?
Claudex is a community nickname for Claude Code used as the coding-agent harness with an OpenAI GPT model underneath. It is not a product from Anthropic, OpenAI or the CLIProxyAPI project.
Why does the viral Claudex alias not work by itself?
It selects gpt-5.6-sol but does not necessarily point Claude Code at CLIProxyAPI or authenticate to the proxy. A complete scoped alias needs ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN after the proxy is installed, configured and connected to Codex OAuth.
Should ENABLE_TOOL_SEARCH be false?
Not by default. False loads every tool definition into the context. Use auto:5 or true when CLIProxyAPI supports the required beta header and tool_reference blocks. Fall back to false only if the proxy rejects those protocol features.
Does CLIProxyAPI expose my computer to the network?
Its example configuration binds all interfaces when host is empty. For a local personal setup, set host to 127.0.0.1, use a strong client API key, keep remote management off and do not expose port 8317 through a router or public tunnel.
Is Claudex suitable for a company?
A local alias is suitable for a controlled experiment, not a production operating model. A company needs approved provider terms, per-user credentials, centralized revocation, audit and redaction, budgets, model allowlists, updates, evals and an incident owner.

Final thoughts

Claudex is useful because it separates two choices that developers often bundle together: the agent harness and the model. You can keep Claude Code's workflow and test GPT-5.6 Sol underneath it. But the proxy, credentials and protocol bridge become part of your system, so they deserve the same verification as any other developer infrastructure.

Install the proxy, bind it to localhost, authenticate Codex, verify the model endpoint, then use a scoped alias. Keep plain Claude Code untouched. Measure the result on accepted tasks, not impressions. If the experiment becomes a team dependency, replace the personal alias with an owned gateway and governance model.

Production AI help

Building an AI product and worried about inference cost, architecture, or production readiness? Wavect helps founders turn AI prototypes into reliable production systems.

Explore the service path:

Inbox, without the noise

Follow the work that matters to you

Get a short email when we publish something new. Follow the whole blog or only the problems you care about.

What would you like to receive?
Choose your topics

Free, double opt-in, no tracking pixels.

Back
Kevin Riedl

11 min read Β· 26 Jul 2026

Next

Get new posts by email

A short email when we publish. Free, no tracking.

Free, double opt-in, no tracking pixels.