From fcff60848ea4cfa4a2437cf057c0a869f57e9748 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 27 Apr 2026 16:34:48 +0900 Subject: [PATCH] feat(providers): split zai api_key_env from zhipu (#84) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `zai` (api.z.ai, the international front-end) and `zhipu` (open.bigmodel.cn, the China front-end) target the same Zhipu account system but are surfaced as distinct providers in the dashboard. They previously both declared `api_key_env = "ZHIPU_API_KEY"`, so configuring a single Zhipu credential silently activated both — same root cause as the cross-product collisions fixed in librefang-registry#82 and librefang-registry#83. Rename `zai` to use its own `ZAI_API_KEY`. `zhipu` keeps `ZHIPU_API_KEY` as the more-established name. This is a breaking change: existing users authenticating `zai` via `ZHIPU_API_KEY` need to also export `ZAI_API_KEY` (same key value works). The companion daemon-side change will be filed against librefang/librefang. Refs librefang/librefang#3282 --- providers/zai.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/providers/zai.toml b/providers/zai.toml index dd55a70..7a50dcd 100644 --- a/providers/zai.toml +++ b/providers/zai.toml @@ -1,10 +1,16 @@ -# Z.AI — https://api.z.ai (Zhipu domain alias) +# Z.AI — https://api.z.ai (international front-end of the same Zhipu backend) # Models: 2 +# +# `zai` and `zhipu` (open.bigmodel.cn) point at the same upstream account +# system but are surfaced as distinct providers in the dashboard. Each now +# uses its own env so configuring one key doesn't auto-activate both — +# export the same Zhipu API key value under whichever name(s) you actually +# use. See librefang/librefang#3282. [provider] id = "zai" display_name = "Z.AI" -api_key_env = "ZHIPU_API_KEY" +api_key_env = "ZAI_API_KEY" base_url = "https://api.z.ai/api/paas/v4" key_required = true