Models: add Vercel AI Gateway auth

This commit is contained in:
Timo Lins
2026-01-16 14:40:56 +01:00
committed by Peter Steinberger
parent 0dcffcd5b0
commit beb9eac5f7
19 changed files with 261 additions and 5 deletions

View File

@@ -88,6 +88,8 @@ export async function setSyntheticApiKey(key: string, agentDir?: string) {
export const ZAI_DEFAULT_MODEL_REF = "zai/glm-4.7";
export const OPENROUTER_DEFAULT_MODEL_REF = "openrouter/auto";
export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF =
"vercel-ai-gateway/anthropic/claude-opus-4.5";
export async function setZaiApiKey(key: string, agentDir?: string) {
// Write to resolved agent dir so gateway finds credentials on startup.
@@ -114,6 +116,18 @@ export async function setOpenrouterApiKey(key: string, agentDir?: string) {
});
}
export async function setVercelAiGatewayApiKey(key: string, agentDir?: string) {
upsertAuthProfile({
profileId: "vercel-ai-gateway:default",
credential: {
type: "api_key",
provider: "vercel-ai-gateway",
key,
},
agentDir: resolveAuthAgentDir(agentDir),
});
}
export async function setOpencodeZenApiKey(key: string, agentDir?: string) {
upsertAuthProfile({
profileId: "opencode:default",