pub enum OpenRouterCapacityStrategy {
SharedCapacity,
ByokFirst,
ByokOnly,
}Expand description
OpenRouter model fallback and provider routing controls.
Organization-level strategy for how OpenRouter should allocate compute capacity.
Controls whether requests use OpenRouter shared credits, prefer customer-owned
upstream keys (BYOK), or require BYOK-only routing. Compiled into OpenRouter
provider routing controls before dispatch; not sent verbatim on the wire.
Variants§
Use OpenRouter shared capacity (credits). No routing changes. Default.
ByokFirst
Prefer providers where the org has registered its own upstream key.
Falls back to shared capacity when BYOK providers are unavailable.
Sets provider.allow_fallbacks = true unless the caller overrides it.
ByokOnly
Require a provider where the org has its own upstream key.
Routing fails if provider.only is not explicitly configured with at
least one BYOK provider slug.
Sets provider.allow_fallbacks = false.
Trait Implementations§
Source§impl Clone for OpenRouterCapacityStrategy
impl Clone for OpenRouterCapacityStrategy
Source§fn clone(&self) -> OpenRouterCapacityStrategy
fn clone(&self) -> OpenRouterCapacityStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OpenRouterCapacityStrategy
Source§impl Debug for OpenRouterCapacityStrategy
impl Debug for OpenRouterCapacityStrategy
Source§impl Default for OpenRouterCapacityStrategy
impl Default for OpenRouterCapacityStrategy
Source§fn default() -> OpenRouterCapacityStrategy
fn default() -> OpenRouterCapacityStrategy
Source§impl<'de> Deserialize<'de> for OpenRouterCapacityStrategy
impl<'de> Deserialize<'de> for OpenRouterCapacityStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OpenRouterCapacityStrategy
Source§impl PartialEq for OpenRouterCapacityStrategy
impl PartialEq for OpenRouterCapacityStrategy
Source§fn eq(&self, other: &OpenRouterCapacityStrategy) -> bool
fn eq(&self, other: &OpenRouterCapacityStrategy) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OpenRouterCapacityStrategy
Auto Trait Implementations§
impl Freeze for OpenRouterCapacityStrategy
impl RefUnwindSafe for OpenRouterCapacityStrategy
impl Send for OpenRouterCapacityStrategy
impl Sync for OpenRouterCapacityStrategy
impl Unpin for OpenRouterCapacityStrategy
impl UnsafeUnpin for OpenRouterCapacityStrategy
impl UnwindSafe for OpenRouterCapacityStrategy
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request