pub struct Proxy { /* private fields */ }Implementations§
Source§impl Proxy
impl Proxy
pub fn new( client: Client, wallet: Wallet, settings: Settings, opts: Options, ) -> Arc<Self> ⓘ
Sourcepub async fn refill(&self, urgent: bool)
pub async fn refill(&self, urgent: bool)
Keep the wallet and passes topped up from the account, in the
background, so customers never move money by hand. Withdrawals happen
when the wallet runs low, not when a session opens, so their timing
says little about any one conversation. urgent skips the backoff
(the wallet is empty and a request is waiting).
Sourcepub async fn helper_secret(&self) -> Result<String>
pub async fn helper_secret(&self) -> Result<String>
The secret of the helper session, opening one if there is none or the
server has closed it. Agents that send it straight to the server
(Claude Code’s apiKeyHelper) ask again after a 401.
Sourcepub async fn watch_helper(&self)
pub async fn watch_helper(&self)
The helper session’s requests never pass through here, so watch its balance instead: a change means it is in use (not idle), and a low balance gets topped up before a request fails for want of money.
Sourcepub async fn close_idle(&self)
pub async fn close_idle(&self)
Close every session that has been quiet for idle_close.