mirror of
https://github.com/acon96/home-llm.git
synced 2026-01-09 21:58:00 -05:00
Fix auth headers for z.ai - remove Bearer prefix
This commit is contained in:
@@ -171,7 +171,7 @@ class AnthropicAPIClient(LocalLLMClient):
|
|||||||
# For compatible APIs, use dummy key and set auth via headers
|
# For compatible APIs, use dummy key and set auth via headers
|
||||||
kwargs["api_key"] = "dummy-key-for-sdk"
|
kwargs["api_key"] = "dummy-key-for-sdk"
|
||||||
kwargs["default_headers"] = {
|
kwargs["default_headers"] = {
|
||||||
"Authorization": f"Bearer {self.api_key}",
|
"Authorization": self.api_key, # No "Bearer" prefix for z.ai compatibility
|
||||||
"x-api-key": self.api_key,
|
"x-api-key": self.api_key,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
@@ -212,8 +212,8 @@ class AnthropicAPIClient(LocalLLMClient):
|
|||||||
# For compatible APIs, use dummy key and set auth via headers
|
# For compatible APIs, use dummy key and set auth via headers
|
||||||
kwargs["api_key"] = "dummy-key-for-sdk"
|
kwargs["api_key"] = "dummy-key-for-sdk"
|
||||||
kwargs["default_headers"] = {
|
kwargs["default_headers"] = {
|
||||||
"Authorization": f"Bearer {api_key}",
|
"Authorization": api_key, # No "Bearer" prefix for z.ai compatibility
|
||||||
"x-api-key": api_key, # Also try Anthropic's native header
|
"x-api-key": api_key,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
kwargs["api_key"] = api_key
|
kwargs["api_key"] = api_key
|
||||||
|
|||||||
Reference in New Issue
Block a user