pub struct Openrouter;Expand description
The OpenRouter [[accounts]] provider token.
Trait Implementations§
Source§impl ProviderBackend for Openrouter
impl ProviderBackend for Openrouter
Source§fn billing(&self) -> BillingModel
fn billing(&self) -> BillingModel
Billing shape.
Source§fn source(&self) -> UsageSourceKind
fn source(&self) -> UsageSourceKind
The source kind this backend’s probe stamps on the snapshots
it returns;
budget refuses a cached snapshot of any other
kind.Source§fn probe<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
account: &'life1 AccountEnv<'life2>,
host: &'life3 dyn ProviderHost,
) -> Pin<Box<dyn Future<Output = Result<UsageSnapshot, ProbeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn probe<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
account: &'life1 AccountEnv<'life2>,
host: &'life3 dyn ProviderHost,
) -> Pin<Box<dyn Future<Output = Result<UsageSnapshot, ProbeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
One probe round-trip: credential resolution, URL derivation,
headers, status classification, payload-to-snapshot mapping.
Strict-vs-lenient mapping lives in the impls, not in a flag.
Source§fn repair(&self, _account: &AccountEnv<'_>, err: &ProbeError) -> RepairAction
fn repair(&self, _account: &AccountEnv<'_>, err: &ProbeError) -> RepairAction
What this backend allows after a failed probe. The shared
default: the auth classes are terminal (an env credential is
fixed when the session spawns and there is no local credential
repair to fire) and
everything else retries. Backends whose provider repairs
differently override this.
Source§fn budget(
&self,
account: &str,
snapshot: Option<&UsageSnapshot>,
) -> AccountBudget
fn budget( &self, account: &str, snapshot: Option<&UsageSnapshot>, ) -> AccountBudget
The budget shape this backend renders for one account’s cached
usage snapshot. Read more
Auto Trait Implementations§
impl Freeze for Openrouter
impl RefUnwindSafe for Openrouter
impl Send for Openrouter
impl Sync for Openrouter
impl Unpin for Openrouter
impl UnsafeUnpin for Openrouter
impl UnwindSafe for Openrouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more