pub struct OpenAICodexResponsesProvider { /* private fields */ }Available on crate feature
openai-codex only.Expand description
OpenAI Codex / ChatGPT subscription provider.
This provider uses the ChatGPT Codex backend (/backend-api/codex/responses)
and requires an OAuth access token obtained from the ChatGPT Plus/Pro login flow.
Implementations§
Source§impl OpenAICodexResponsesProvider
impl OpenAICodexResponsesProvider
Sourcepub fn new(api_key: String, model: String) -> OpenAICodexResponsesProvider
pub fn new(api_key: String, model: String) -> OpenAICodexResponsesProvider
Create a new OpenAI Codex provider.
Sourcepub fn with_base_url(
api_key: String,
model: String,
base_url: String,
) -> OpenAICodexResponsesProvider
pub fn with_base_url( api_key: String, model: String, base_url: String, ) -> OpenAICodexResponsesProvider
Create a provider with a custom base URL.
Sourcepub fn gpt53_codex(api_key: String) -> OpenAICodexResponsesProvider
pub fn gpt53_codex(api_key: String) -> OpenAICodexResponsesProvider
Create a provider using GPT-5.3-Codex (latest codex model).
Sourcepub fn codex(api_key: String) -> OpenAICodexResponsesProvider
pub fn codex(api_key: String) -> OpenAICodexResponsesProvider
Create a provider using the latest Codex model.
Sourcepub fn gpt54(api_key: String) -> OpenAICodexResponsesProvider
pub fn gpt54(api_key: String) -> OpenAICodexResponsesProvider
Create a provider using GPT-5.4 (frontier reasoning with 1.05M context).
Sourcepub const fn with_thinking(
self,
thinking: ThinkingConfig,
) -> OpenAICodexResponsesProvider
pub const fn with_thinking( self, thinking: ThinkingConfig, ) -> OpenAICodexResponsesProvider
Set the provider-owned thinking configuration for this model.
Sourcepub fn with_account_id(
self,
account_id: impl Into<String>,
) -> OpenAICodexResponsesProvider
pub fn with_account_id( self, account_id: impl Into<String>, ) -> OpenAICodexResponsesProvider
Set a known ChatGPT account id, avoiding JWT decoding on each request.
Sourcepub fn with_reasoning_effort(
self,
effort: ReasoningEffort,
) -> OpenAICodexResponsesProvider
pub fn with_reasoning_effort( self, effort: ReasoningEffort, ) -> OpenAICodexResponsesProvider
Set the reasoning effort level.
Trait Implementations§
Source§impl Clone for OpenAICodexResponsesProvider
impl Clone for OpenAICodexResponsesProvider
Source§fn clone(&self) -> OpenAICodexResponsesProvider
fn clone(&self) -> OpenAICodexResponsesProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl LlmProvider for OpenAICodexResponsesProvider
impl LlmProvider for OpenAICodexResponsesProvider
Source§fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatOutcome, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAICodexResponsesProvider: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatOutcome, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAICodexResponsesProvider: 'async_trait,
Non-streaming chat completion.
Source§fn chat_stream(
&self,
request: ChatRequest,
) -> Pin<Box<dyn Stream<Item = Result<StreamDelta, Error>> + Send + '_>>
fn chat_stream( &self, request: ChatRequest, ) -> Pin<Box<dyn Stream<Item = Result<StreamDelta, Error>> + Send + '_>>
Streaming chat completion. Read more
fn model(&self) -> &str
fn provider(&self) -> &'static str
Source§fn configured_thinking(&self) -> Option<&ThinkingConfig>
fn configured_thinking(&self) -> Option<&ThinkingConfig>
Provider-owned thinking configuration, if any.
Source§fn capabilities(&self) -> Option<&'static ModelCapabilities>
fn capabilities(&self) -> Option<&'static ModelCapabilities>
Canonical capability metadata for this provider/model, if known.
Source§fn validate_thinking_config(
&self,
thinking: Option<&ThinkingConfig>,
) -> Result<(), Error>
fn validate_thinking_config( &self, thinking: Option<&ThinkingConfig>, ) -> Result<(), Error>
Validate a thinking configuration against the provider/model capabilities. Read more
Source§fn resolve_thinking_config(
&self,
request_thinking: Option<&ThinkingConfig>,
) -> Result<Option<ThinkingConfig>, Error>
fn resolve_thinking_config( &self, request_thinking: Option<&ThinkingConfig>, ) -> Result<Option<ThinkingConfig>, Error>
Resolve the effective thinking configuration for a request. Read more
Source§fn default_max_tokens(&self) -> u32
fn default_max_tokens(&self) -> u32
Default maximum output tokens for this provider/model when the caller
does not explicitly override
AgentConfig.max_tokens.Source§fn structured_output_support(&self) -> StructuredOutputSupport
fn structured_output_support(&self) -> StructuredOutputSupport
How this provider satisfies a structured-output
(
ResponseFormat) request. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OpenAICodexResponsesProvider
impl !UnwindSafe for OpenAICodexResponsesProvider
impl Freeze for OpenAICodexResponsesProvider
impl Send for OpenAICodexResponsesProvider
impl Sync for OpenAICodexResponsesProvider
impl Unpin for OpenAICodexResponsesProvider
impl UnsafeUnpin for OpenAICodexResponsesProvider
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
Mutably borrows from an owned value. Read more