Skip to content

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

fix: normalize Anthropic header keys to lowercase in provider registry

Prakersh Maheshwaria42ef13b6188
diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts
index 73f0311f39..7e3ef2080b 100644
--- a/open-sse/config/providerRegistry.ts
+++ b/open-sse/config/providerRegistry.ts
@@ -128,8 +128,8 @@ const KIMI_CODING_SHARED = {
baseUrl: "https://api.kimi.com/coding/v1/messages",
authHeader: "x-api-key",
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
{ id: "kimi-k2.5", name: "Kimi K2.5" },
@@ -275,11 +275,11 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authHeader: "x-api-key",
defaultContextLength: 200000,
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_CLAUDE_OAUTH,
- "Anthropic-Dangerous-Direct-Browser-Access": "true",
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_CLAUDE_OAUTH,
+ "anthropic-dangerous-direct-browser-access": "true",
"User-Agent": CLAUDE_CLI_USER_AGENT,
- "X-App": "cli",
+ "x-app": "cli",
"X-Stainless-Helper-Method": "stream",
"X-Stainless-Retry-Count": "0",
"X-Stainless-Runtime-Version": CLAUDE_CLI_STAINLESS_RUNTIME_VERSION,
@@ -622,8 +622,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authHeader: "x-api-key",
defaultContextLength: 200000,
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
{ id: "claude-haiku-4.5", name: "Claude Haiku 4.5" },
@@ -762,8 +762,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "x-api-key",
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
{ id: "qwen3.5-plus", name: "Qwen3.5 Plus" },
@@ -787,8 +787,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "x-api-key",
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
{ id: "glm-5", name: "GLM 5" },
@@ -919,8 +919,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "bearer",
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
// T12/T28: MiniMax default upgraded from M2.5 to M2.7
@@ -943,8 +943,8 @@ export const REGISTRY: Record<string, RegistryEntry> = {
authType: "apikey",
authHeader: "bearer",
headers: {
- "Anthropic-Version": ANTHROPIC_VERSION_HEADER,
- "Anthropic-Beta": ANTHROPIC_BETA_API_KEY,
+ "anthropic-version": ANTHROPIC_VERSION_HEADER,
+ "anthropic-beta": ANTHROPIC_BETA_API_KEY,
},
models: [
// Keep parity with minimax to ensure model discovery works for minimax-cn connections.
diff --git a/tests/unit/search-provider-validation.test.ts b/tests/unit/search-provider-validation.test.ts
index 453c463541..7285fc95b8 100644
--- a/tests/unit/search-provider-validation.test.ts
+++ b/tests/unit/search-provider-validation.test.ts
@@ -79,7 +79,7 @@ test("kimi-coding-apikey validation uses Kimi Coding messages endpoint", async (
assert.equal(calls[0].url, "https://api.kimi.com/coding/v1/messages");
assert.equal(calls[0].method, "POST");
assert.equal(calls[0].headers["x-api-key"], "sk-kimi-test");
- assert.equal(calls[0].headers["Anthropic-Version"], "2023-06-01");
+ assert.equal(calls[0].headers["anthropic-version"], "2023-06-01");
for (const call of calls) {
assert.equal(call.url.includes("?beta=true/messages"), false);
diff --git a/tests/unit/t20-t22-provider-headers.test.ts b/tests/unit/t20-t22-provider-headers.test.ts
index 2df405816a..2ece1c4999 100644
--- a/tests/unit/t20-t22-provider-headers.test.ts
+++ b/tests/unit/t20-t22-provider-headers.test.ts
@@ -33,10 +33,10 @@ test("T20: gemini CLI fingerprint uses 0.31.0 and preserves darwin platform name
test("T25: anthropic API-key config includes the full Anthropic beta header set", () => {
const anthropic = REGISTRY.anthropic;
- assert.equal(anthropic.headers["Anthropic-Version"], "2023-06-01");
- assert.ok(anthropic.headers["Anthropic-Beta"]?.includes("advanced-tool-use-2025-11-20"));
- assert.ok(anthropic.headers["Anthropic-Beta"]?.includes("structured-outputs-2025-12-15"));
- assert.ok(anthropic.headers["Anthropic-Beta"]?.includes("token-efficient-tools-2026-03-28"));
+ assert.equal(anthropic.headers["anthropic-version"], "2023-06-01");
+ assert.ok(anthropic.headers["anthropic-beta"]?.includes("advanced-tool-use-2025-11-20"));
+ assert.ok(anthropic.headers["anthropic-beta"]?.includes("structured-outputs-2025-12-15"));
+ assert.ok(anthropic.headers["anthropic-beta"]?.includes("token-efficient-tools-2026-03-28"));
});
test("T22: github headers include updated editor/plugin versions and required fields", () => {