mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Add a protocol-translating reverse proxy that allows using OpenAI-compatible API providers (DeepSeek, OpenRouter, Groq, etc.) with Claude Code. The proxy intercepts Anthropic Messages API requests from the CLI, transforms them to OpenAI Chat Completions or Responses API format, forwards to the upstream provider, and transforms streaming/non-streaming responses back. Key features: - Request transform: Anthropic Messages → OpenAI Chat/Responses - Response transform: OpenAI → Anthropic (streaming SSE + non-streaming) - Provider-agnostic reasoning support (reasoning_content, thinking_blocks, reasoning fields from DeepSeek, OpenAI o-series, GLM-5, Groq, etc.) - Event queue pattern for correct Anthropic SSE event ordering - Two-step test: ① connectivity check ② full proxy pipeline validation - Desktop UI: API format selector, two-step test results display - License attribution for cc-switch (MIT, Jason Young) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>