Add Vercel AI Gateway provider support (#1183)
This commit is contained in:
1 parent
a168313290
commit
9326589452
7 files changed
+20
No files matched your search
@@ -399,6 +399,10 @@ async function testApiKeyConnection(connection, effectiveProxy = null) {
|
||||
const res = await fetchWithConnectionProxy("https://api.openai.com/v1/models", { headers: { Authorization: `Bearer ${connection.apiKey}` } }, effectiveProxy);
|
||||
return { valid: res.ok, error: res.ok ? null : "Invalid API key" };
|
||||
}
|
||||
case "vercel-ai-gateway": {
|
||||
const res = await fetchWithConnectionProxy("https://ai-gateway.vercel.sh/v1/models", { headers: { Authorization: `Bearer ${connection.apiKey}` } }, effectiveProxy);
|
||||
return { valid: res.ok, error: res.ok ? null : "Invalid API key" };
|
||||
}
|
||||
case "anthropic": {
|
||||
const res = await fetchWithConnectionProxy("https://api.anthropic.com/v1/messages", {
|
||||
method: "POST",
|
||||
|
||||
Reference in new issue
Block a user