pub struct ProviderConfig {Show 14 fields
pub api_key: Option<String>,
pub azure: Option<ProviderConfigAzure>,
pub base_url: String,
pub bearer_token: Option<String>,
pub has_bearer_token_provider: Option<bool>,
pub headers: Option<HashMap<String, String>>,
pub max_context_window_tokens: Option<f64>,
pub max_output_tokens: Option<f64>,
pub max_prompt_tokens: Option<f64>,
pub model_id: Option<String>,
pub transport: Option<ProviderConfigTransport>,
pub type: Option<ProviderConfigType>,
pub wire_api: Option<ProviderConfigWireApi>,
pub wire_model: Option<String>,
}Expand description
Custom model-provider configuration (BYOK).
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
Fields§
§api_key: Option<String>API key. Optional for local providers like Ollama.
azure: Option<ProviderConfigAzure>Azure-specific provider options.
base_url: StringAPI endpoint URL.
bearer_token: Option<String>Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set.
has_bearer_token_provider: Option<bool>When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session providerToken.getToken callback before each request and applies the returned token as an Authorization: Bearer <token> header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic’s), not a provider-specific API-key header such as Anthropic’s x-api-key. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside apiKey/bearerToken, the callback takes precedence: the runtime applies the token returned by providerToken.getToken as the Authorization: Bearer header for each request and does not send the static credential.
headers: Option<HashMap<String, String>>Custom HTTP headers to include in all outbound requests to the provider.
max_context_window_tokens: Option<f64>Maximum context window tokens for the model.
max_output_tokens: Option<f64>Maximum output tokens for the model.
max_prompt_tokens: Option<f64>Maximum prompt/input tokens for the model.
model_id: Option<String>Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model.
transport: Option<ProviderConfigTransport>Provider transport. Defaults to “http”.
type: Option<ProviderConfigType>Provider type. Defaults to “openai” for generic OpenAI-compatible APIs.
wire_api: Option<ProviderConfigWireApi>Wire API format (openai/azure only). Defaults to “completions”.
wire_model: Option<String>The model identifier sent to the provider API for inference (the “wire” model), as opposed to modelId which is the well-known base.
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§fn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more