pub struct ProviderConfig {Show 23 fields
pub vendor: Option<String>,
pub api_key: Option<String>,
pub base_url: Option<String>,
pub model: Option<String>,
pub context_window: Option<u32>,
pub model_context_windows: Option<BTreeMap<String, u32>>,
pub mode: Option<String>,
pub wire: Option<String>,
pub responses_profile: Option<String>,
pub auth_mode: Option<String>,
pub oauth: Option<PluginOAuthConfig>,
pub oauth_credential_generation: Option<String>,
pub insecure_skip_tls_verify: Option<bool>,
pub allow_insecure_http: Option<bool>,
pub http_headers: Option<HashMap<String, String>>,
pub path_suffix: Option<String>,
pub reasoning_stream_style: Option<String>,
pub max_concurrency: Option<usize>,
pub auth: Option<ProviderAuthSourceToml>,
pub external_credentials: Option<ExternalCredentialConsentToml>,
pub kind: Option<String>,
pub plugin_authority: Option<PluginAuthority>,
pub api_key_env: Option<String>,
}Fields§
§vendor: Option<String>OpenRouter upstream slug; disables upstream fallbacks when set.
api_key: Option<String>§base_url: Option<String>§model: Option<String>§context_window: Option<u32>§model_context_windows: Option<BTreeMap<String, u32>>Per-model context-window overrides keyed by exact wire model id
([providers.<name>.model_context_windows], #6108). A matching entry
wins over this provider’s context_window for that model only, so one
gateway can front models with heterogeneous windows.
mode: Option<String>§wire: Option<String>Dual-wire dialect toggle: openai (default) or anthropic.
Not a separate catalog provider — config only (DeepSeek / MiniMax /
Model Studio).
responses_profile: Option<String>Responses dialect for a custom table whose wire is responses.
auth_mode: Option<String>§oauth: Option<PluginOAuthConfig>Core-owned public-client OAuth descriptor for a named plugin provider.
oauth_credential_generation: Option<String>Validated basename of the active Codewhale-owned xAI OAuth generation. The file always lives below Codewhale’s private credentials directory.
insecure_skip_tls_verify: Option<bool>§allow_insecure_http: Option<bool>Per-provider consent to a plain-HTTP base_url (#5991). Loopback is
always allowed without it.
http_headers: Option<HashMap<String, String>>§path_suffix: Option<String>§reasoning_stream_style: Option<String>§max_concurrency: Option<usize>§auth: Option<ProviderAuthSourceToml>§external_credentials: Option<ExternalCredentialConsentToml>Explicit, provider-scoped consent for one credential file owned by another CLI. Absence is the disabled default.
kind: Option<String>Wire-protocol selector for a custom [providers.<name>] entry (#1519).
Only "openai-compatible" is accepted for now; any other value is
rejected at selection time so unsupported wire formats fail loudly rather
than silently routing as OpenAI. Built-in providers leave this unset.
Runtime-only receipt; a config file cannot manufacture plugin authority.
api_key_env: Option<String>Name of the environment variable holding this custom provider’s API key
(#1519), e.g. api_key_env = "EXAMPLE_API_KEY". The key value itself is
never stored in config; only the env var name is.
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn is_openai_compatible_custom(&self) -> bool
pub fn is_openai_compatible_custom(&self) -> bool
True when this entry selects the OpenAI-compatible custom wire protocol.
kind is matched case-insensitively against openai-compatible (and the
openai_compatible underscore spelling). Returns false when kind is
unset (built-in providers) or names any other value.
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§impl Debug for ProviderConfig
impl Debug for ProviderConfig
Source§impl Default for ProviderConfig
impl Default for ProviderConfig
Source§impl<'de> Deserialize<'de> for ProviderConfig
impl<'de> Deserialize<'de> for ProviderConfig
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>,
Auto Trait Implementations§
impl Forget for ProviderConfig
impl Freeze for ProviderConfig
impl Move for ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnsafeUnpin for ProviderConfig
impl UnwindSafe for ProviderConfig
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.