spoof User-Agent for Agent Router calls to bypass unauthorized client detection

This commit is contained in:
rarebuffalo
2026-06-15 02:54:16 +05:30
parent b1fa5890e8
commit d132536284
3 changed files with 26 additions and 0 deletions

View File

@@ -53,6 +53,10 @@ async def call_ai(
if api_base:
kwargs["api_base"] = api_base
if "agentrouter.org" in api_base.lower():
kwargs["extra_headers"] = {
"User-Agent": "claude-code/0.2.9",
}
if json_mode:
kwargs["response_format"] = {"type": "json_object"}