Add http-referer header for vercel ai gateway requests (#1403)

This commit is contained in:
Josh
2025-07-30 20:22:24 -07:00
committed by GitHub
parent 31b8e3d5ab
commit 4a221868da

View File

@@ -97,7 +97,7 @@ export namespace Provider {
Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"),
)
}
} catch {}
} catch { }
const headers: Record<string, string> = {
...init.headers,
...copilot.HEADERS,
@@ -194,6 +194,17 @@ export namespace Provider {
},
}
},
vercel: async () => {
return {
autoload: false,
options: {
headers: {
"http-referer": "https://opencode.ai/",
"x-title": "opencode",
},
},
}
},
}
const state = App.state("provider", async () => {