pub struct OpenAICodexResponsesProvider { /* private fields */ }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.
Sourcepub const fn with_websockets_disabled(
self,
disabled: bool,
) -> OpenAICodexResponsesProvider
pub const fn with_websockets_disabled( self, disabled: bool, ) -> OpenAICodexResponsesProvider
Force the HTTP transport, skipping the WebSocket path entirely.
In a WebSocket-hostile environment (a corporate proxy / firewall that
black-holes the wss upgrade) the WebSocket-first transport stalls for
up to the connect + warmup timeout budget on every fresh session before
falling back to HTTP. An operator who knows their network cannot do
wss can set this to skip the penalty entirely. The
OPENAI_CODEX_DISABLE_WEBSOCKETS environment variable does the
same without a code change.
Trait Implementations§
Source§impl Clone for OpenAICodexResponsesProvider
impl Clone for OpenAICodexResponsesProvider
Source§fn clone(&self) -> OpenAICodexResponsesProvider
fn clone(&self) -> OpenAICodexResponsesProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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,
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 + '_>>
fn model(&self) -> &str
fn provider(&self) -> &'static str
Source§fn configured_thinking(&self) -> Option<&ThinkingConfig>
fn configured_thinking(&self) -> Option<&ThinkingConfig>
Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelInfo>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModelInfo>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn capabilities(&self) -> Option<&'static ModelCapabilities>
fn capabilities(&self) -> Option<&'static ModelCapabilities>
Source§fn validate_thinking_config(
&self,
thinking: Option<&ThinkingConfig>,
) -> Result<(), Error>
fn validate_thinking_config( &self, thinking: Option<&ThinkingConfig>, ) -> Result<(), Error>
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>
Source§fn default_max_tokens(&self) -> u32
fn default_max_tokens(&self) -> u32
AgentConfig.max_tokens.Source§fn structured_output_support(&self) -> StructuredOutputSupport
fn structured_output_support(&self) -> StructuredOutputSupport
ResponseFormat) request. Read more