mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-03-24 16:33:48 +08:00
Fixes Nvidia provider and other providers using apiFormat="openai_chat". The ClaudeAdapter::build_url() method was incorrectly adding ?beta=true to both /v1/messages and /v1/chat/completions endpoints. This caused the Nvidia provider to fail because: 1. Nvidia uses apiFormat="openai_chat" 2. Requests are transformed to OpenAI format and sent to /v1/chat/completions 3. The URL gets ?beta=true appended (Anthropic-specific parameter) 4. Nvidia's API rejects requests with this parameter Fix: - Only add ?beta=true to /v1/messages endpoint - Exclude /v1/chat/completions from getting this parameter Tested: - Anthropic /v1/messages still gets ?beta=true ✓ - OpenAI Chat Completions /v1/chat/completions does NOT get ?beta=true ✓ - All 13 Claude adapter tests pass ✓ Co-authored-by: jnorthrup <jnorthrup@example.com>