Skip to content

docs: add Claude Code routing via CLIProxyAPI demo#989

Closed
Jiliac wants to merge 1 commit into
katanemo:mainfrom
Jiliac:adil/claude-code-cliproxy-demo
Closed

docs: add Claude Code routing via CLIProxyAPI demo#989
Jiliac wants to merge 1 commit into
katanemo:mainfrom
Jiliac:adil/claude-code-cliproxy-demo

Conversation

@Jiliac

@Jiliac Jiliac commented Jul 14, 2026

Copy link
Copy Markdown

Summary

Adds a reproducible demo for routing Claude Code across Codex subscription models through Plano while delegating protocol translation and OAuth handling to a local CLIProxyAPI upstream.

The data path is:

Claude Code -> Plano preference routing -> CLIProxyAPI /v1/messages -> Codex OAuth

This keeps Plano focused on preference routing and model aliases, while CLIProxyAPI owns the Anthropic-to-Codex compatibility layer.

Included

  • Plano v0.4 config with three Anthropic-compatible upstream models:
    • gpt-5.6-sol for diagnosis-only deep reasoning
    • gpt-5.6-terra for implementation work
    • gpt-5.6-luna for quick developer utilities
  • Claude family fallback aliases: Fable→Sol, Opus→Terra, Sonnet/Haiku→Luna
  • Loopback-only CLIProxyAPI config example with management disabled
  • Small preflight-only claude-plano launcher that:
    • validates loopback binding
    • authenticates /v1/models
    • verifies all required models
    • checks Plano health
    • removes the proxy key before executing Claude Code
  • Full setup guide for Homebrew and non-Homebrew installs, Codex OAuth login, local/native startup, Docker production isolation, troubleshooting, rollback, and context-window model naming
  • Mock-based launcher tests and structural config/README policy validation

Important boundaries

  • CLIProxyAPI is an independent MIT-licensed project, not part of Plano, Anthropic, or OpenAI.
  • Public wire model IDs remain unsuffixed. Claude Code client annotations such as [1m] are optional client-side hints and are not CLIProxyAPI model IDs.
  • Top-level routing preferences override Claude family alias targets when a route matches; aliases remain initial/fallback targets.
  • Native Plano internal listeners are explicitly pinned to loopback in the documented development command. Docker isolation is recommended for production.
  • The public launcher intentionally does not use --dangerously-skip-permissions.

Test plan

cd demos/llm_routing/claude_code_cliproxy
./test.sh
shfmt -i 2 -ci -d claude-plano test.sh tests/*.sh
shellcheck claude-plano test.sh tests/*.sh
ruby -c validate_configs.rb
ruby validate_configs.rb config.yaml cliproxyapi.conf.example

All checks pass locally. Tests use mocks and do not require credentials, OAuth login, or model inference.

Validation performed during development

The integration was also exercised end-to-end outside the committed test suite with Claude Code single-turn, multi-turn, streaming/non-streaming, file tools, Explore subagents, all four Claude alias families, hosted Sol/Terra/Luna routing, and direct-proxy fallback.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@Jiliac

Jiliac commented Jul 15, 2026

Copy link
Copy Markdown
Author

I'm my usage, this has proved unstable. So I'm closing the PR.

@Jiliac Jiliac closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant