lich0821/ccNexus
Go API gateway for Claude Code and Codex CLI with failover and protocol conversion
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
ccNexus is a Go HTTP gateway that sits between Claude Code or Codex CLI and upstream model APIs. Claude Code points to the gateway root; Codex CLI uses a provider base URL ending in /v1 and selects the responses or chat wire API. Each endpoint selects a request format converter. A configured endpoint model overrides the client’s model name; otherwise the original name is forwarded.
The source tree includes cmd/ and internal/. The module declares Go 1.24.0 with toolchain go1.24.3, and includes Wails v2.11.0 and modernc.org/sqlite. ccNexus offers a cross-platform desktop app and a headless HTTP server. WebDAV sync covers configuration and data. The gateway handles routing and API translation; model inference happens upstream.
Key Capabilities & Differentiators
When an endpoint fails, ccNexus switches to the next configured endpoint. Its converters cover Claude, OpenAI Chat, OpenAI Responses, and Gemini. Operators can filter and clone endpoint entries, and clients can query /v1/models, which serves cached results by default and supports on-demand refresh when enabled.
The Codex Token Pool imports access_token and refresh_token pairs in batches, rotates credentials, refreshes after a 401, and isolates invalid credentials. It tracks requests, errors, and token usage per credential. In v5.4.0, proxy changes corrected forwarding of OpenAI image generation and editing requests and added support for multi-megabyte SSE events.
Trade-offs & Limitations
Compared with connecting an OpenAI-compatible client directly to the OpenAI API, ccNexus adds protocol conversion, endpoint failover, and credential-level visibility, but also adds another service to configure and troubleshoot. Switching endpoints can help when one fails, but a converted request or a model-name override does not make providers interchangeable. Test the client features you rely on, notably streaming and any non-text requests, across each intended primary and fallback endpoint.
The MIT license permits self-hosting and commercial use subject to its notice requirements; upstream service terms still apply. A Token Pool puts multiple refresh credentials at the gateway, making credential and host access controls important. Before enabling WebDAV sync, verify what data is synchronized and who can access the destination.
Hardware & Deployment Guide
Run a desktop release on Windows, macOS, or Linux, or use the headless HTTP server via Docker; container setup is covered in docs/README_DOCKER.md. The default port is 3000, overridable with -port or CCNEXUS_PORT. If Basic Auth is enabled without a configured password, startup generates one and prints it to the log. Keep the service on a trusted network or put it behind a reverse proxy with TLS and access controls, and restrict access to startup logs.
Self-hosting moves the gateway onto your infrastructure, not the models: requests still require a reachable upstream, and the gateway itself does not need model VRAM. Start sizing around concurrent streams and payload sizes, especially large SSE events. v5.3.0 added headless Basic Auth, endpoint cloning, and the cached models API; v5.4.0 focused on proxy reliability and the management UI.
Developers and teams that want Claude Code or Codex CLI to use multiple upstreams through one self-hosted endpoint, with failover and centralized usage tracking.
One upstream already meets your needs, you need offline model execution, or you require exact provider-native behavior across all features without testing the conversion layer.
Quick Start & Installation
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "随便写,不重要",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:3000",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "64000", // 有些模型可能不支持 64k
}
// 其他配置
}Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| ccNexus ★ | 961 | — | Go | MIT | Go API gateway for Claude Code and Codex CLI with failover and protocol conversi |
| freellmapi | 62k | +2.6k | TypeScript | MIT | Self-hosted LLM gateway for routing across free tiers and custom endpoints |
| bifrost | 10.2k | +125 | Go | Apache-2.0 | Self-hosted Go gateway for routing and governing multi-provider LLM traffic |
| gpt-load | 7.2k | +6 | Go | MIT | Self-hosted Go gateway for routing LLM traffic across providers and credentials |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/lich0821/ccNexus.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ccNexus
How do I connect Claude Code or Codex CLI to an upstream provider?
Does ccNexus need a GPU, and what drives its resource usage?
Can a company self-host ccNexus under its MIT license?
When is ccNexus preferable to connecting directly to the OpenAI API?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy