Z.ai (ZhipuAI) static-API-key provider helpers. Each plan is registered as its own extension:
:zai-coding-plan -> coding-plan subscription
(https://api.z.ai/api/coding/paas/v4).
Env var: ZAI_CODING_API_KEY.
:zai -> pay-as-you-go / Pass gateway
(https://api.z.ai/api/paas/v4).
Env var: ZAI_API_KEY.
Both endpoints serve the same GLM model family (glm-5-turbo,
glm-5.1, glm-4.7, glm-4.6, glm-4.6v, ...) with binary
thinking (:zai-thinking reasoning-style - handled by svar). They
share helper code, but the runtime extension registry sees one
extension entry per provider id.
Auth lifecycle:
vis providers auth zai-coding (or vis providers auth zai) prompts for the API
key once and persists it under ~/.vis/zai-auth.json,
{:coding {:api-key str :saved-at long} :pass {:api-key str :saved-at long}}.:api-key wins so status/limits
match the key used for model calls; env vars
(ZAI_CODING_API_KEY, ZAI_API_KEY) override the auth file when
present so CI / scripted setups stay home-directory-free.vis providers status zai-coding reports the source
(config / env / file) without exposing the full key.vis providers logout zai-coding clears the persisted key for
that plan only; the other plan stays intact.Z.ai (ZhipuAI) static-API-key provider helpers. Each plan is registered as its own extension:
:zai-coding-plan -> coding-plan subscription
(https://api.z.ai/api/coding/paas/v4).
Env var: `ZAI_CODING_API_KEY`.
:zai -> pay-as-you-go / `Pass` gateway
(https://api.z.ai/api/paas/v4).
Env var: `ZAI_API_KEY`.
Both endpoints serve the same GLM model family (`glm-5-turbo`,
`glm-5.1`, `glm-4.7`, `glm-4.6`, `glm-4.6v`, ...) with binary
thinking (`:zai-thinking` reasoning-style - handled by svar). They
share helper code, but the runtime extension registry sees one
extension entry per provider id.
Auth lifecycle:
1. `vis providers auth zai-coding` (or `vis providers auth zai`) prompts for the API
key once and persists it under `~/.vis/zai-auth.json`,
`{:coding {:api-key str :saved-at long}
:pass {:api-key str :saved-at long}}`.
2. Subsequent runs read the configured provider key, env var, or
persisted key. A TUI/config `:api-key` wins so status/limits
match the key used for model calls; env vars
(`ZAI_CODING_API_KEY`, `ZAI_API_KEY`) override the auth file when
present so CI / scripted setups stay home-directory-free.
3. `vis providers status zai-coding` reports the source
(config / env / file) without exposing the full key.
4. `vis providers logout zai-coding` clears the persisted key for
that plan only; the other plan stays intact.(authenticated?)True if any plan has a usable key from any source. Convenience for doctor-style probes; not part of the provider contract.
True if any plan has a usable key from any source. Convenience for doctor-style probes; not part of the provider contract.
(logout!)Clear BOTH persisted plan keys. Plan-specific logout goes through
vis providers logout <plan> which dispatches to the per-plan
logout-fn registered below.
Clear BOTH persisted plan keys. Plan-specific logout goes through `vis providers logout <plan>` which dispatches to the per-plan logout-fn registered below.
(status)Aggregate status across both plans. Useful at the REPL.
Aggregate status across both plans. Useful at the REPL.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |