Expand description
The gateway’s key route: an agent’s own Anthropic API key, an account of Connectors > Accounts.
The agent is pointed at /api/v1/model/anthropic/... with a token that names it and the account
(token::token_for_account). Each request is checked against the agent’s current link to that account, so a
switch or an unlink ends the token’s use at once, and the key is read from the keychain here, for the one
request, and sent as x-api-key. The agent’s environment, files and processes never hold it.
Structs§
- KeyAccount 🔒
- The key to send upstream, and the name the person gave its account (for the messages that name it).
Functions§
- audit_
foreign_ 🔒use - A gateway token was shown by a peer other than the container it was made for (or with no proof of which it was from,
peernone): one Audit row, naming the agent and the account’s display name or the route, and never the token. The token has already ended. - foreign_
use_ 🔒reporter - What the container listener tells when a key account’s token is shown by a peer other than its container.
- key_of 🔒
readoff the async runtime.- label_
of 🔒 - named_
error 🔒 - An error answer from Anthropic (a rejected key, a used-up credit), with the account’s name added to its message, so
the failure the agent shows names the account and nothing of the key. Other answers are returned as they are.
Errholds the finished answer,Okthe response to relay as it is. - read 🔒
- The key of the account
grantspends, when the agent is still linked to it. BLOCKING (store and keychain reads). - requested_
model 🔒 - The model a request names, for counting its answer at that family’s price.