Documentation
¶
Overview ¶
Package codex provides a raw model.Provider for ChatGPT-backed Codex subscription access. It targets a private and volatile wire contract at a fixed trusted endpoint. Applications own login, token refresh, persistence, and credential policy and inject current credentials for each request.
The provider supports SSE, fresh-per-request WebSockets, and WebSocket-first automatic selection with one safe pre-output SSE fallback. It does not read environment variables, Codex CLI state, home-directory files, or keychains, and it does not implement model.TokenCounter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements model.Provider through the private ChatGPT Codex Responses wire contract. It intentionally does not implement model.TokenCounter.
type CredentialSource ¶
type CredentialSource interface {
Credentials(context.Context) (Credentials, error)
}
CredentialSource resolves current Codex credentials for each logical request.
type CredentialSourceFunc ¶
type CredentialSourceFunc func(context.Context) (Credentials, error)
CredentialSourceFunc adapts a function into a CredentialSource.
func (CredentialSourceFunc) Credentials ¶
func (f CredentialSourceFunc) Credentials(ctx context.Context) (Credentials, error)
Credentials resolves credentials through f.
type Credentials ¶
Credentials contains application-owned credentials for one Codex request.
type Options ¶
type Options struct {
CredentialSource CredentialSource
HTTPClient *http.Client
WebSocketDialer *websocket.Dialer
Transport Transport
ClientVersion string
ResponsesLite bool
StreamIdleTimeout time.Duration
// ReasoningEffort selects a provider effort identifier; empty uses the provider default.
ReasoningEffort string
DefaultModel string
HighModel string
SmallModel string
}
Options configures the Codex subscription provider.