fix(openrouter): use correct X-Title header for app attribution
OpenRouter requires 'X-Title' header for app attribution, not 'X-OpenRouter-Title'. The incorrect header name caused OpenRouter to not recognize requests as coming from OpenClaw, resulting in free models (e.g., xiaomi/mimo-v2-pro) being charged at full price. Changes: - Replace 'X-OpenRouter-Title' with 'X-Title' per OpenRouter docs - Remove unnecessary 'X-OpenRouter-Categories' header - Update tests to match corrected headers Reference: https://openrouter.ai/docs/app-attribution Fixes #50738
This commit is contained in:
parent
ba811b4629
commit
ddecd5226b
@ -34,8 +34,7 @@ describe("provider attribution", () => {
|
||||
version: "2026.3.14",
|
||||
headers: {
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-Title": "OpenClaw",
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -47,8 +46,7 @@ describe("provider attribution", () => {
|
||||
}),
|
||||
).toEqual({
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": "OpenClaw",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-Title": "OpenClaw",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -54,8 +54,7 @@ function buildOpenRouterAttributionPolicy(
|
||||
...identity,
|
||||
headers: {
|
||||
"HTTP-Referer": "https://openclaw.ai",
|
||||
"X-OpenRouter-Title": identity.product,
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
"X-Title": identity.product,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user