Liking cljdoc? Tell your friends :D
Clojure only.

com.blockether.vis.internal.provider.vendor.alibaba

Alibaba Model Studio static-API-key providers. Each plan is registered as its own extension:

:alibaba-coding-plan -> Coding Plan subscription (https://coding-intl.dashscope.aliyuncs.com/v1). Env var: ALIBABA_CODING_PLAN_API_KEY.

:alibaba-token-plan -> Token Plan prepaid token bundle (https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1). Env var: ALIBABA_TOKEN_PLAN_API_KEY.

Both endpoints speak the OpenAI-compatible chat wire (/chat/completions, SSE streaming with stream_options.include_usage, native tool_calls, reasoning_content for thinking models), so svar's default :openai-compatible-chat api-style drives them unchanged.

The plans are SEPARATE credentials: a Token Plan key is rejected by the Coding Plan endpoint and vice versa (HTTP 401 InvalidApiKey). Hence one provider id, one env var and one auth-file slice per plan - never a shared ALIBABA_API_KEY fallback that would silently authenticate as the wrong plan.

The provider ids match their models.dev slugs, which is what lets svar resolve pricing, context windows and capabilities for the catalog models listed in each preset; svar's KNOWN_PROVIDERS has no Alibaba entry, so the preset here owns :base-url (svar accepts an unknown provider id whenever a base URL is supplied).

Auth lifecycle:

  1. vis-agent providers auth alibaba-coding-plan (or vis-agent providers auth alibaba-token-plan) takes the API key once and persists it under ~/.vis/alibaba-auth.json, as canonical snake_case JSON - top-level plan tag, then api_key / saved_at (never kebab, never keyword keys).
  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; the env vars override the auth file when present so CI / scripted setups stay home-directory-free.
  3. vis-agent providers status alibaba-coding-plan reports the source (config / env / file) without exposing the full key.
  4. vis-agent providers logout alibaba-coding-plan clears the persisted key for that plan only; the other plan stays intact.
Alibaba Model Studio static-API-key providers. Each plan is registered as its own extension:

  :alibaba-coding-plan -> Coding Plan subscription
                (https://coding-intl.dashscope.aliyuncs.com/v1).
                Env var: `ALIBABA_CODING_PLAN_API_KEY`.

  :alibaba-token-plan  -> Token Plan prepaid token bundle
                (https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1).
                Env var: `ALIBABA_TOKEN_PLAN_API_KEY`.

Both endpoints speak the OpenAI-compatible chat wire (`/chat/completions`,
SSE streaming with `stream_options.include_usage`, native `tool_calls`,
`reasoning_content` for thinking models), so svar's default
`:openai-compatible-chat` api-style drives them unchanged.

The plans are SEPARATE credentials: a Token Plan key is rejected by the
Coding Plan endpoint and vice versa (HTTP 401 `InvalidApiKey`). Hence one
provider id, one env var and one auth-file slice per plan - never a shared
`ALIBABA_API_KEY` fallback that would silently authenticate as the wrong
plan.

The provider ids match their models.dev slugs, which is what lets svar
resolve pricing, context windows and capabilities for the catalog models
listed in each preset; svar's `KNOWN_PROVIDERS` has no Alibaba entry, so
the preset here owns `:base-url` (svar accepts an unknown provider id
whenever a base URL is supplied).

Auth lifecycle:
  1. `vis-agent providers auth alibaba-coding-plan` (or
     `vis-agent providers auth alibaba-token-plan`) takes the API key once
     and persists it under `~/.vis/alibaba-auth.json`, as canonical
     snake_case JSON - top-level plan tag, then `api_key` / `saved_at`
     (never kebab, never keyword keys).
  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; the env vars override the auth file when
     present so CI / scripted setups stay home-directory-free.
  3. `vis-agent providers status alibaba-coding-plan` reports the source
     (config / env / file) without exposing the full key.
  4. `vis-agent providers logout alibaba-coding-plan` clears the persisted
     key for that plan only; the other plan stays intact.
raw docstring

register!clj

(register!)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close