Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
fix(sse): add Claude-to-Claude passthrough for anthropic-compatible providers
Prakersh Maheshwari6ff7b6570c45
diff --git a/open-sse/handlers/chatCore.ts b/open-sse/handlers/chatCore.tsindex 1919add060..666ba975b0 100644--- a/open-sse/handlers/chatCore.ts+++ b/open-sse/handlers/chatCore.ts@@ -182,10 +182,17 @@ export async function handleChatCore({// Translate request (pass reqLogger for intermediate logging)let translatedBody = body;+ const isClaudePassthrough = sourceFormat === FORMATS.CLAUDE && targetFormat === FORMATS.CLAUDE;try {if (nativeCodexPassthrough) {translatedBody = { ...body, _nativeCodexPassthrough: true };log?.debug?.("FORMAT", "native codex passthrough enabled");+ } else if (isClaudePassthrough) {+ // Claude-to-Claude passthrough: forward body completely untouched.+ // No translation, no field stripping, no thinking normalization.+ // We are just a gateway -- do not interfere with the request in any way.+ translatedBody = body;+ log?.debug?.("FORMAT", "claude->claude passthrough -- forwarding untouched");} else {translatedBody = { ...body };diff --git a/open-sse/translator/index.ts b/open-sse/translator/index.tsindex ce3f353f60..5b75f54685 100644--- a/open-sse/translator/index.ts+++ b/open-sse/translator/index.ts@@ -131,7 +131,7 @@ export function translateRequest(}// Final step: prepare request for Claude format endpoints- if (targetFormat === FORMATS.CLAUDE) {+ if (targetFormat === FORMATS.CLAUDE && sourceFormat !== FORMATS.CLAUDE) {result = prepareClaudeRequest(result, provider);}