Expand description
Whether a Claude Code session paid by the developer’s own Claude
subscription (billing = subscription) can work through this deployment’s
AI Gateway, checked before it is started and at the end of visdom init:
- the gateway takes subscription traffic (
gateway.subscription), - Claude Code is signed in with a claude.ai subscription
(
gateway.claude_login), - the model alias is one the gateway takes a subscription call on
(
gateway.subscription_model), - a subscription key is issued (or kept) and the gateway accepts it
(
gateway.subscription_key), - nothing in Claude Code’s settings takes the session over from that
login (
gateway.claude_settings).
Structs§
- Claude
Env - The
envof every Claude Code settings layer that applies over the environment a session is started in, the one that wins first: the settings an organisation manages, the caller’s own--settings(the later one first), the project’s.claude/settings.local.jsonand.claude/settings.json, the user’ssettings.json.visdom’s launch sets the model as environment, so any of these that names one wins. - Model
Use - A model alias Claude Code will ask for, and who set it (
None: the aliasvisdomconfigured or picked).
Enums§
- Claude
Login - How Claude Code is signed in, as
claude auth statussays. - KeyState
- The state of the subscription key, as far as it was checked.
Constants§
- ALTERNATIVES
- The commands behind the two ways out
NOT_SUPPORTEDnames. - NOT_
SUPPORTED - What the developer is told when the platform does not take subscription traffic: printed word for word (the product owner’s wording).
- OTHER_
MODEL_ SETTINGS - Claude Code’s other settings that name a model a session may ask for,
beside
ANTHROPIC_MODELandANTHROPIC_DEFAULT_HAIKU_MODEL. The list is Claude Code’s: a setting it gains has to be added here.
Functions§
- claude_
login - Ask Claude Code (
program) how it is signed in, in the environment a sessionvisdomstarts would have: without the keys and provider switches the launch removes, which would otherwise be reported instead of the login. - eligible_
of - The aliases of
availablethe gateway takes a subscription call on inproject; none when it does not say. - is_
not_ supported - Whether
whyisNOT_SUPPORTED, which is then printed on its own. - key_
finding gateway.subscription_key, with the expiry date.- login_
finding gateway.claude_login: whether Claude Code has the claude.ai login the subscription is paid through.- managed_
settings_ path - Where Claude Code reads the settings an organisation manages, which come
after everything
visdompasses.VISDOM_CLAUDE_MANAGED_SETTINGSnames another file (an unusual installation, and the tests). - managed_
takeovers - What in the managed settings
settingstakes a subscription session over: they come aftervisdom’s own, so it cannot set them aside. - model_
finding gateway.subscription_model: whether every alias ofusesis one the gateway takes a subscription call on, inproject.sourceis wherevisdom’s own alias was set;config_keyis the setting that names it. A gateway that does not publish which aliases qualify cannot be relied on to keep a subscription call off another provider: an error too.- models_
in_ use - The aliases a session started now would ask for: the main model (the
caller’s
--model, elseANTHROPIC_MODELas the session sees it — a settings layer, else the environment, which the launch keeps — elseconfigured) and the small one (ANTHROPIC_DEFAULT_HAIKU_MODEL, elseconfigured).envgives a variable’s value and where it is set. - probe_
settings - The settings
auth statusis asked with, and whether they include the caller’s own: the caller’s--settings, merged as the launch merges them, under what the launch sets aside — the developer’s key helper (which Claude Code 2.1.332 would report asauthMethod: api_key_helper, tried by hand, instead of the login the session uses), keys and provider switches. - read_
auth_ status - Read what
claude auth statusprinted. A claude.ai login stored beside a key that takes precedence elsewhere (a key helper in the developer’s settings, whichvisdomsets aside) still counts as the login. - settings_
finding gateway.claude_settings: nothing in Claude Code’s settings takes the session over from the claude.ai login. Settings an organisation manages that would are an error; a key helper in the developer’s own settings is set aside in sessionsvisdomstarts, but not in a Claude Code started without it (source <(visdom env)cannot), so it is a warning.project_diris the checkout whose.claude/settings apply.- traffic_
finding gateway.subscription: whether the gateway takes subscription traffic. Denied, or not said (a gateway from before the setting), isNOT_SUPPORTEDon the first line.