mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-02 09:07:34 +08:00
refactor(proxy): switch OpenRouter to passthrough mode for native Claude API
OpenRouter now supports Claude Code compatible endpoint (/v1/messages), eliminating the need for Anthropic ↔ OpenAI format conversion. - Disable format transformation for OpenRouter (keep old logic as fallback) - Pass through original endpoint instead of redirecting to /v1/chat/completions - Add anthropic-version header for ClaudeAuth and Bearer strategies - Update tests to reflect new passthrough behavior
This commit is contained in:
@@ -87,7 +87,7 @@ pub trait ProviderAdapter: Send + Sync {
|
||||
/// 是否需要格式转换
|
||||
///
|
||||
/// 默认返回 `false`(透传模式)。
|
||||
/// 仅当供应商需要格式转换时(如 Claude + OpenRouter)才返回 `true`。
|
||||
/// 仅当供应商需要格式转换时(如 Claude + OpenRouter 旧 OpenAI 兼容接口)才返回 `true`。
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `provider` - Provider 配置
|
||||
|
||||
Reference in New Issue
Block a user