A multi-provider native proxy for Anthropic and OpenAI.
ccflare routes each provider by URL prefix, load-balances across multiple accounts, and keeps full request history, rate-limit state, and usage analytics without translating provider payloads.
- Native passthrough β Anthropic stays Anthropic, OpenAI stays OpenAI
- Multi-provider routing β route by
/v1/{provider}/* - Compatibility routes β route by
/v1/ccflare/*with family-prefixed models - Account failover β retry another account when one provider account is rate limited
- Built-in observability β dashboard, request history, analytics, logs, and health endpoints
- Flexible auth β API key and OAuth account support, including Grok Build browser login
git clone https://github.com/snipeship/ccflare
cd ccflare
bun install
# Start the server + dashboard on http://localhost:8080
bun run start
# Or launch the TUI, which can also start the server
bun run ccflareVerify the server is up:
curl http://localhost:8080/healthccflare proxies requests by provider prefix:
http://localhost:8080/v1/anthropic/*http://localhost:8080/v1/openai/*http://localhost:8080/v1/kimi/*POST http://localhost:8080/v1/grok/responseshttp://localhost:8080/v1/ccflare/*
Examples:
/v1/anthropic/v1/messagesβhttps://api.anthropic.com/v1/messages/v1/openai/chat/completionsβhttps://api.openai.com/v1/chat/completions/v1/openai/responsesβhttps://api.openai.com/v1/responses/v1/kimi/chat/completionsβhttps://api.kimi.com/coding/v1/chat/completions/v1/grok/responsesβhttps://cli-chat-proxy.grok.com/v1/responses
The /v1/{provider} prefix is stripped exactly once before forwarding upstream.
Compatibility routes keep the client-facing schema but select a provider family from
the model prefix:
openai/<model-id>β preferscodex, thenopenaianthropic/<model-id>β prefersclaude-code, thenanthropic
An unprefixed model uses the route's native family (openai on OpenAI
compatibility routes and anthropic on Anthropic compatibility routes).
Kimi and Grok models are native-only. Grok uses /v1/grok/responses, and
compatibility routes reject kimi/ and grok/ model IDs with native-route guidance.
Examples:
/v1/ccflare/openai/chat/completionswith"model":"openai/gpt-5.4"/v1/ccflare/openai/responseswith"model":"anthropic/claude-sonnet-4"/v1/ccflare/anthropic/messageswith"model":"openai/gpt-4o-mini"
Add accounts through the management API:
curl -X POST http://localhost:8080/api/accounts \
-H "content-type: application/json" \
-d '{
"name": "anthropic-main",
"provider": "anthropic",
"auth_method": "api_key",
"api_key": "sk-ant-..."
}'
curl -X POST http://localhost:8080/api/accounts \
-H "content-type: application/json" \
-d '{
"name": "openai-main",
"provider": "openai",
"auth_method": "api_key",
"api_key": "sk-openai-..."
}'Use the CLI/TUI for interactive OAuth setup:
# Claude Code OAuth
bun run ccflare --add-account work --provider claude-code
# Codex OAuth
bun run ccflare --add-account codex --provider codex
# Grok Build OAuth (the browser callback completes automatically)
bun run ccflare --add-account grok-work --provider grokThe management API also exposes provider-specific auth endpoints:
POST /api/auth/anthropic/initPOST /api/auth/anthropic/completePOST /api/auth/openai/initPOST /api/auth/openai/complete
Point Anthropic SDKs or curl at the Anthropic-prefixed base URL:
export ANTHROPIC_BASE_URL=http://localhost:8080/v1/anthropicPoint OpenAI-compatible clients at the OpenAI-prefixed base URL:
export OPENAI_BASE_URL=http://localhost:8080/v1/openaiYou can configure both providers at the same time and ccflare will keep account selection isolated per provider.
Codex can use one Claudeflare provider with model-specific native routes for
OpenAI Responses, Claude Code Messages, and Kimi Chat Completions. Configure the
static catalog overlay and named wire routes as shown in the
Codex configuration example.
The picker shows canonical catalog IDs such as anthropic/claude-sonnet-5 and
kimi/k3, while Codex also accepts the overlay's pi aliases such as sonnet-5,
5.6-sol, and k3. Codex resolves aliases before sending the canonical ID to
ccflare. The catalog's inference metadata selects the native provider route;
the proxy does not route aliases itself.
curl -X POST http://localhost:8080/v1/anthropic/v1/messages \
-H "content-type: application/json" \
-d '{
"model": "claude-3-7-sonnet",
"max_tokens": 128,
"messages": [
{ "role": "user", "content": "Say hello from ccflare." }
]
}'curl -X POST http://localhost:8080/v1/openai/chat/completions \
-H "content-type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Say hello from ccflare." }
]
}'curl -X POST http://localhost:8080/v1/openai/responses \
-H "content-type: application/json" \
-d '{
"model": "gpt-4o",
"input": "Summarize why provider-prefixed routing is useful."
}'curl -X POST http://localhost:8080/v1/ccflare/openai/chat/completions \
-H "content-type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4",
"messages": [
{ "role": "user", "content": "Say hello from the compatibility route." }
]
}'Key endpoints:
GET /healthβ status, account count, strategy, supported providersGET /api/accountsβ list accountsGET /api/accounts/:id/quotaβ fetch and cache live quota for one Claude Code, Codex, Kimi, or Grok accountPOST /api/accounts/:id/rate-limit/resetβ clear local rate-limit gating for one accountGET /api/accounts/:id/modelsβ fetch the live model catalog for one Codex or Grok accountPOST /api/accountsβ create an accountPATCH /api/accounts/:idβ update an account (rename, changebase_url)DELETE /api/accounts/:idβ remove an accountPOST /api/accounts/:id/pause/resumeβ exclude or restore an accountPOST /api/accounts/:id/renameβ rename an accountGET /api/requestsβ recent request summariesGET /api/requests/:id/detailβ detailed request payload for one exact request IDGET /api/requests/:id/conversationβ HTTP conversation JSON or full WebSocket transcript NDJSON exportGET /api/requests/streamβ live request summary stream via SSEGET /api/requests/:id/transcriptβ paged raw WebSocket transcript chunksGET /api/requests/:id/transcript/streamβ live request-scoped WebSocket transcript streamGET /api/analyticsβ aggregated analyticsGET /api/statsβ usage and performance statsPOST /api/stats/resetβ reset usage statisticsGET /api/logs/streamβ live server logs via SSEGET /api/logs/historyβ historical log entriesGET /api/configβ current configurationGET /api/config/strategyβ current load balancing strategyPOST /api/config/strategyβ update load balancing strategyGET /api/strategiesβ list available strategiesGET /api/config/retentionβ data retention settingsPOST /api/config/retentionβ update data retention settingsPOST /api/maintenance/cleanupβ run data cleanupPOST /api/maintenance/compactβ compact the database
- Dashboard:
http://localhost:8080 - TUI:
bun run ccflare - Server only:
bun run start
- Bun >= 1.2.8
- Anthropic and/or OpenAI credentials
Additional repo docs live in docs/:
MIT β see LICENSE.
