feat(openai): inject app attribution headers for OpenRouter and Vercel AI Gateway

This commit is contained in:
zhayujie
2026-05-20 11:43:17 +08:00
parent 4a1f62b185
commit 16b7271826
2 changed files with 41 additions and 3 deletions

View File

@@ -422,8 +422,9 @@ class _AzureChatHTTPClient(OpenAIHTTPClient):
)
self._api_version = api_version
def _build_headers(self, api_key, extra_headers):
# Azure uses api-key header, not Bearer token.
def _build_headers(self, api_key, extra_headers, url=None):
# Azure uses api-key header, not Bearer token. No attribution
# headers — Azure deployments are the customer's own tenant.
key = api_key if api_key is not None else self.api_key
headers = {"Content-Type": "application/json"}
if key: