Changed handling of OpenRouter requests to add some custom headers so that it can see the app (#613)

Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
Ciaran McAleer 2025-07-02 19:43:59 +01:00 committed by GitHub
parent 35d6273fb3
commit 63e783ef79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,6 +205,17 @@ export namespace Provider {
},
}
},
openrouter: async (provider) => {
return {
autoload: false,
options: {
headers: {
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
},
},
}
},
}
const state = App.state("provider", async () => {