One local daemon. Both Claude Code and Codex CLI talk to it.
Anthropic-compatible and OpenAI-compatible on the same port — plus a local SQLite ledger for every request. Provider keys stay on your machine.
Latest: v0.4.0 — encrypted ledger, dashboard, /metrics, streaming passthrough. Try the live demo before installing.
brew install XZXY-AI/tap/ccg-router
ccg-router init
export ANTHROPIC_BASE_URL=http://127.0.0.1:17180
export OPENAI_BASE_URL=http://127.0.0.1:17180
ccg-router start
How is this different from claude-code-router?
| claude-code-router | ccg-router | |
|---|---|---|
| Claude Code routing | ✓ | ✓ |
| Codex CLI routing | — | ✓ |
| One daemon for both CLIs | — | ✓ |
| Local SQLite usage ledger | — | ✓ |
| Multiple routing strategies | — | prefer-cheaper · prefer-capable · round-robin |
| Hosted control plane | — | — (also no) |
Only use Claude Code? claude-code-router is more mature for that case. ccg-router exists for the dual-CLI workflow.
Claude Code router
Accept Anthropic-compatible /v1/messages traffic locally.
Codex CLI router
Accept OpenAI-compatible /v1/chat/completions traffic on the same daemon.
Local ledger
Record request metadata in SQLite without storing prompts or provider keys.
What works today
v0.2 adds streaming passthrough for both protocols. End-to-end usable as a daily driver: routing strategies, upstream config, signed preset registry loading, release binaries, Homebrew, read-only local dashboard, and full streaming support.
What is next
Streaming passthrough, richer dashboard metrics, more adapters, encrypted ledger options, and provider preset workflows.
Search topics
Claude Code router Codex CLI router OpenAI-compatible proxy Anthropic-compatible proxy local LLM router AI coding CLI routerPopular searches
ANTHROPIC_BASE_URL
Point Claude Code at a local Anthropic-compatible router.
OPENAI_BASE_URL
Point Codex CLI at a local OpenAI-compatible router.
Usage tracking
Track AI coding request metadata in a local SQLite ledger.
Tutorials
One local router
Use the same local daemon for Claude Code and Codex CLI.
Compatible proxy
Run OpenAI-compatible and Anthropic-compatible endpoints on one port.
Local usage ledger
Track AI coding request metadata in local SQLite.
Troubleshooting
ANTHROPIC_BASE_URL not working
Fix Claude Code local router setup issues.
OPENAI_BASE_URL not working
Fix Codex CLI local router setup issues.
More error fixes
Homebrew, Go install, and doctor troubleshooting.