Skip to main content

Module key_account

Module key_account 

Source
Expand description

An Anthropic API key as an account a Claude agent can be moved onto (docs/specs/SPEC_AGENT_PANE_API_KEY_ACCOUNT_SWITCH_2026_11_16.md).

A key account is stored under provider anthropic, not claude, and its link stays under anthropic: the spawn then carries it through the gateway’s key route (identity::resolver::inject_steps::inject_key_route), so the agent never holds the key. An agent has exactly one payer: moving it onto a key removes its plan link, and moving it onto a plan removes the key link. Nothing here is reached by the automatic moves: a failover picks only accounts of the agent’s own provider, and machine::scan leaves a pane on a key out of the episodes.

Functions§

can_take_a_key 🔒
Why def_id cannot be moved onto a key account now, or Ok. An agent on a model route is billed to the route. A container agent can take a key: its container reaches the gateway, never the key (container::key_route), and a container with no way to the gateway says so at the turn, with what to do instead.
is_key
An Anthropic API key: provider anthropic, kind api_key.
is_link_of 🔒
Whether a link stored under link_provider is one of the account links of an agent whose provider is provider.
left_the_key 🔒
The agent just left its API key: its gateway token stops working now, whatever a running process still holds.
link_provider 🔒
The provider a link to to is stored under for an agent of provider: a key’s own, else the agent’s.
serves 🔒
Whether a can be the account of an agent whose (canonical) provider is provider: an account of that provider, or, for a Claude agent, an Anthropic API key.