pub enum Provider {
Anthropic,
Codex,
Openrouter,
Zai,
}Expand description
Which backend an account talks to, declared per [[accounts]] in
forge.toml. This is the single source of truth for how the account
is probed and how its usage renders; nothing infers either from
ANTHROPIC_BASE_URL, which answers where the credential lives
rather than what the backend bills for.
Variants§
Anthropic
Anthropic proper: a setup-token credential, plan windows on the default host.
Codex
A claude-code-proxy endpoint. Base-url like OpenRouter, but its
proxy serves the same windowed /api/oauth/usage body Anthropic
does, so it bills as a subscription.
Openrouter
OpenRouter: pay-per-token, probed at {base_url}/v1/key. No
plan windows and no allowance, so its usage is spend over a
period rather than a percentage.
Zai
Z.ai GLM coding plan: a credit-windowed subscription probed at the monitor host derived from the base url’s host root. Chat rides the same env-override shape as the other base-url providers.
Implementations§
Source§impl Provider
impl Provider
Sourcepub const ACCEPTED: &'static str = "\"anthropic\", \"codex\", \"openrouter\", \"zai\""
pub const ACCEPTED: &'static str = "\"anthropic\", \"codex\", \"openrouter\", \"zai\""
Every accepted provider value, for the load error a missing or
unusable declaration produces.
Sourcepub const fn uses_base_url(self) -> bool
pub const fn uses_base_url(self) -> bool
true when the account authenticates with a flat token
beside a flat base_url (a base-url provider). Both the probe
and preflight’s repair copy branch on this rather than on the
provider itself. The billing model lives on the provider’s
forge-gateway backend instead.
Trait Implementations§
impl Copy for Provider
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Provider, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Provider, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Provider
Source§impl Serialize for Provider
impl Serialize for Provider
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Provider
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnsafeUnpin for Provider
impl UnwindSafe for Provider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.