Anthropic providers.
Providers:
:anthropic - normal Anthropic API key provider. API key lives in Vis config.:anthropic-coding-plan - Claude subscription OAuth provider. OAuth
credentials live in ~/.vis/anthropic-auth.json.Runtime calls hand the OAuth access token to svar; svar handles only the Anthropic Messages API wire differences for subscription tokens.
Anthropic providers. Providers: - `:anthropic` - normal Anthropic API key provider. API key lives in Vis config. - `:anthropic-coding-plan` - Claude subscription OAuth provider. OAuth credentials live in `~/.vis/anthropic-auth.json`. Runtime calls hand the OAuth access token to svar; svar handles only the Anthropic Messages API wire differences for subscription tokens.
(clear-limits-cache!)Clear the in-process Anthropic usage cache. Intended for tests and
forced provider refreshes; normal callers should use limits.
Clear the in-process Anthropic usage cache. Intended for tests and forced provider refreshes; normal callers should use `limits`.
(create-authorization-flow)Create Anthropic Claude subscription OAuth PKCE flow data.
Create Anthropic Claude subscription OAuth PKCE flow data.
(detect-credentials)Detect persisted Anthropic OAuth credentials without network validation.
Detect persisted Anthropic OAuth credentials without network validation.
(force-refresh-token!)(force-refresh-token! rejected-token)Force an OAuth refresh-token exchange, persist the rotated credentials,
and return {:token <new-access-token>}.
get-anthropic-token! only refreshes when the stored token is locally
expired, so a token that is locally-valid but has been invalidated
server-side (refresh-token rotation by another client/process) would
otherwise never be replaced. The runtime's 401 recovery path calls this
to break that deadlock. Goes through the single-flight
refresh-and-persist!, so a STORM of 401s (every iteration's retry, the
usage poll) collapses into one exchange instead of racing the rotating
refresh token into HTTP 400.
rejected-token (optional) is the access token the server just 401'd:
the single-flight reuse step will NOT hand it back, forcing a real
exchange when the on-file token is still the dead one. Throws when there
is no refresh token.
Force an OAuth refresh-token exchange, persist the rotated credentials,
and return `{:token <new-access-token>}`.
`get-anthropic-token!` only refreshes when the stored token is locally
expired, so a token that is locally-valid but has been invalidated
server-side (refresh-token rotation by another client/process) would
otherwise never be replaced. The runtime's 401 recovery path calls this
to break that deadlock. Goes through the single-flight
`refresh-and-persist!`, so a STORM of 401s (every iteration's retry, the
usage poll) collapses into one exchange instead of racing the rotating
refresh token into HTTP 400.
`rejected-token` (optional) is the access token the server just 401'd:
the single-flight reuse step will NOT hand it back, forcing a real
exchange when the on-file token is still the dead one. Throws when there
is no refresh token.(get-anthropic-token!)Return a fresh Anthropic Claude subscription access token for Vis runtime.
Return a fresh Anthropic Claude subscription access token for Vis runtime.
(login! printer-fn)(login! printer-fn
{:keys [open-browser-fn manual-code-fn force?]
:or {open-browser-fn open-browser! manual-code-fn prompt-for-code!}})Run Anthropic Claude subscription OAuth and persist credentials.
Options:
:open-browser-fn (fn [url] boolean) override for tests/frontends.:manual-code-fn (fn [printer-fn] string|nil) collector.:force? starts fresh even if credentials already exist.Run Anthropic Claude subscription OAuth and persist credentials. Options: - `:open-browser-fn` `(fn [url] boolean)` override for tests/frontends. - `:manual-code-fn` `(fn [printer-fn] string|nil)` collector. - `:force?` starts fresh even if credentials already exist.
(parse-authorization-input input)Parse a pasted Anthropic OAuth callback URL, query string, code#state, or bare code.
Parse a pasted Anthropic OAuth callback URL, query string, `code#state`, or bare code.
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 |