feat(providers): add Z.AI/Zhipu GLM multi-configuration support

Add four distinct provider variants for GLM models:
- zai: International pay-as-you-go (api.z.ai)
- zai-coding: International Coding Plan (api.z.ai/coding)
- zhipu: China pay-as-you-go (bigmodel.cn)
- zhipu-coding: China Coding Plan (bigmodel.cn/coding)

Includes:
- Provider config functions with proper base URLs
- GLM model definition (glm-4.7, 205K context)
- Env var resolution with fallback chains
- Provider ID normalization for aliases
- Usage provider IDs and labels

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
committed 2026-01-29 16:18:51 +00:00
1 parent 718bc3f9c8
commit 719ab3b4c5
9 files changed
+362 -6

No files matched your search

+14
View File
@@ -255,6 +255,20 @@ export function resolveEnvApiKey(provider: string): EnvApiKeyResult | null {
return pick("ZAI_API_KEY") ?? pick("Z_AI_API_KEY");
}
if (normalized === "zai-coding") {
// Coding plan can use same key as general, just different endpoint
return pick("ZAI_CODING_API_KEY") ?? pick("ZAI_API_KEY") ?? pick("Z_AI_API_KEY");
}
if (normalized === "zhipu") {
return pick("ZHIPU_API_KEY");
}
if (normalized === "zhipu-coding") {
// Coding plan can use same key as general, just different endpoint
return pick("ZHIPU_CODING_API_KEY") ?? pick("ZHIPU_API_KEY");
}
if (normalized === "google-vertex") {
const envKey = getEnvApiKey(normalized);
if (!envKey) return null;