pub enum ApiBackend {
Native,
OpenRouter,
Proxy,
}Expand description
Which endpoint family the wire talks to — selects auth header + quirks.
This is configuration, not a wire schema: all three speak Anthropic Messages
(Provider::api_schema() stays "anthropic").
Variants§
Native
First-party api.anthropic.com — auth via x-api-key.
OpenRouter
OpenRouter’s Anthropic-compatible endpoint (plan §9.2) — Bearer auth,
betas mirrored to x-anthropic-beta, provider preferences injected.
Proxy
Any other Anthropic-compatible gateway — Bearer auth, no extra quirks.
Implementations§
Source§impl ApiBackend
impl ApiBackend
Sourcepub fn detect(base_url: &str) -> ApiBackend
pub fn detect(base_url: &str) -> ApiBackend
Detect the backend from a base URL (pinnable by setting the field directly).
openrouter.ai (any subdomain) → ApiBackend::OpenRouter;
api.anthropic.com → ApiBackend::Native; anything else →
ApiBackend::Proxy. Matches the “base-URL override changes the auth
header” rule (ADR-0007 consequences).
Trait Implementations§
Source§impl Clone for ApiBackend
impl Clone for ApiBackend
Source§fn clone(&self) -> ApiBackend
fn clone(&self) -> ApiBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ApiBackend
Source§impl Debug for ApiBackend
impl Debug for ApiBackend
impl Eq for ApiBackend
Source§impl PartialEq for ApiBackend
impl PartialEq for ApiBackend
impl StructuralPartialEq for ApiBackend
Auto Trait Implementations§
impl Freeze for ApiBackend
impl RefUnwindSafe for ApiBackend
impl Send for ApiBackend
impl Sync for ApiBackend
impl Unpin for ApiBackend
impl UnsafeUnpin for ApiBackend
impl UnwindSafe for ApiBackend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.