pub struct ModelProviderConfig {
pub name: Option<String>,
pub base_url: Option<String>,
pub api_path: Option<String>,
pub wire_api: Option<String>,
pub requires_openai_auth: bool,
pub azure_openai_resource: Option<String>,
pub azure_openai_deployment: Option<String>,
pub azure_openai_api_version: Option<String>,
pub max_tokens: Option<u32>,
}Expand description
Named provider profile definition compatible with Codex app-server style config.
Fields§
§name: Option<String>Optional provider type/name override (e.g. “openai”, “openai-codex”, or custom profile id).
base_url: Option<String>Optional base URL for OpenAI-compatible endpoints.
api_path: Option<String>Optional custom API path suffix (e.g. “/v2/generate” instead of the default “/v1/chat/completions”). Only used by OpenAI-compatible / custom providers.
wire_api: Option<String>Provider protocol variant (“responses” or “chat_completions”).
requires_openai_auth: boolIf true, load OpenAI auth material (OPENAI_API_KEY or ~/.codex/auth.json).
azure_openai_resource: Option<String>Azure OpenAI resource name (e.g. “my-resource” in https://my-resource.openai.azure.com).
azure_openai_deployment: Option<String>Azure OpenAI deployment name (e.g. “gpt-4o”).
azure_openai_api_version: Option<String>Azure OpenAI API version (defaults to “2024-08-01-preview”).
max_tokens: Option<u32>Optional maximum output tokens to send in API requests.
When set, overrides the provider’s default max_tokens value.
Useful for providers like OpenRouter where the platform default (65536)
may exceed a model’s actual limit.
Trait Implementations§
Source§impl Clone for ModelProviderConfig
impl Clone for ModelProviderConfig
Source§fn clone(&self) -> ModelProviderConfig
fn clone(&self) -> ModelProviderConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelProviderConfig
impl Debug for ModelProviderConfig
Source§impl Default for ModelProviderConfig
impl Default for ModelProviderConfig
Source§fn default() -> ModelProviderConfig
fn default() -> ModelProviderConfig
Source§impl<'de> Deserialize<'de> for ModelProviderConfig
impl<'de> Deserialize<'de> for ModelProviderConfig
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>,
Source§impl JsonSchema for ModelProviderConfig
impl JsonSchema for ModelProviderConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ModelProviderConfig
impl RefUnwindSafe for ModelProviderConfig
impl Send for ModelProviderConfig
impl Sync for ModelProviderConfig
impl Unpin for ModelProviderConfig
impl UnsafeUnpin for ModelProviderConfig
impl UnwindSafe for ModelProviderConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more