mirror of
https://github.com/BoPeng/ai-marketplace-monitor.git
synced 2025-12-23 22:28:18 -05:00
Add OpenRouter user agent identification headers (#241)
Addresses GitHub issue #240 by adding proper application identification when using OpenRouter API. This ensures the application appears as "AI Marketplace Monitor" in OpenRouter's dashboard instead of "Unknown" and provides a direct link to the GitHub repository. - Added X-Title header with application name - Added HTTP-Referer header with repository URL - Follows OpenRouter's recommended identification practices
This commit is contained in:
@@ -255,6 +255,10 @@ class OpenAIBackend(AIBackend):
|
||||
api_key=self.config.api_key,
|
||||
base_url=self.config.base_url or self.base_url,
|
||||
timeout=self.config.timeout,
|
||||
default_headers={
|
||||
"X-Title": "AI Marketplace Monitor",
|
||||
"HTTP-Referer": "https://github.com/BoPeng/ai-marketplace-monitor",
|
||||
},
|
||||
)
|
||||
if self.logger:
|
||||
self.logger.info(f"""{hilight("[AI]", "name")} {self.config.name} connected.""")
|
||||
|
||||
Reference in New Issue
Block a user