pub struct Provider {
pub order: Option<Vec<String>>,
pub allow_fallbacks: Option<bool>,
pub require_parameters: Option<bool>,
pub data_collection: Option<String>,
pub only: Option<Vec<String>>,
pub ignore: Option<Vec<String>>,
pub quantizations: Option<Vec<String>>,
pub sort: Option<String>,
pub max_price: Option<Value>,
pub zdr: Option<bool>,
}Expand description
Provider routing controls. Fleshed out further in Phase 3.
Fields§
§order: Option<Vec<String>>Ordered preference list of provider slugs.
allow_fallbacks: Option<bool>Whether OpenRouter may fall back to other providers on failure.
require_parameters: Option<bool>Require providers to accept every supplied sampling parameter.
data_collection: Option<String>Data-collection policy ("allow" / "deny").
only: Option<Vec<String>>Allowlist of provider slugs.
ignore: Option<Vec<String>>Denylist of provider slugs.
quantizations: Option<Vec<String>>Allowed quantization tiers.
sort: Option<String>Sort strategy: "throughput", "price", or "latency".
max_price: Option<Value>Per-token max price filter (free-form JSON value).
zdr: Option<bool>Require zero-data-retention endpoints.
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn with_order<S, I>(self, order: I) -> Self
pub fn with_order<S, I>(self, order: I) -> Self
Ordered preference list of provider slugs.
Sourcepub fn with_sort(self, sort: impl Into<String>) -> Self
pub fn with_sort(self, sort: impl Into<String>) -> Self
Sort strategy: "throughput", "price", or "latency".
Sourcepub fn with_allow_fallbacks(self, allow: bool) -> Self
pub fn with_allow_fallbacks(self, allow: bool) -> Self
Whether OpenRouter may fall back to other providers if the preferred ones fail.
Sourcepub fn with_ignore<S, I>(self, ignore: I) -> Self
pub fn with_ignore<S, I>(self, ignore: I) -> Self
Exclude these providers from consideration.
Sourcepub fn with_quantizations<S, I>(self, q: I) -> Self
pub fn with_quantizations<S, I>(self, q: I) -> Self
Permitted quantization tiers (e.g. "fp8", "int4").
Sourcepub fn with_max_price(self, price: Value) -> Self
pub fn with_max_price(self, price: Value) -> Self
Per-token max price filter (free-form value, see OpenRouter docs).
Sourcepub fn with_data_collection(self, policy: impl Into<String>) -> Self
pub fn with_data_collection(self, policy: impl Into<String>) -> Self
Data-collection policy: "allow" or "deny".
Sourcepub fn with_require_parameters(self, required: bool) -> Self
pub fn with_require_parameters(self, required: bool) -> Self
Require that providers accept all supplied sampling parameters.