Versions in this module Expand all Collapse all v0 v0.1.0 Sep 8, 2026 Changes in this version + const AuthURL + const ClientID + const Scopes + const TokenURL + var Catalog = []Model + var ErrNotAuthenticated = errors.New(...) + func AuthorizeURL(state string, pkce *PKCE, callbackPort int) (string, error) + func CodexCLIAuthPath() string + func CodexCLIHome() string + func NewSessionID() string + func RandomState() (string, error) + func RedirectURI(port int) string + type APIError struct + Body []byte + StatusCode int + func (e *APIError) Error() string + type AuthInfo struct + ChatGPTAccountID string + ChatGPTPlanType string + ChatGPTUserID string + UserID string + type Backend struct + BaseURL string + HTTP *http.Client + Originator string + Store *Store + UserAgent string + func NewBackend(baseURL, userAgent, originator string, store *Store, ...) *Backend + func (b *Backend) Responses(ctx context.Context, body []byte, sessionID string) (*http.Response, error) + type BootstrapOption struct + Description string + DisabledReason *string + Model string + Name string + type Claims struct + Auth AuthInfo + Email string + Exp int64 + func ParseIDToken(token string) (*Claims, error) + type Client struct + HTTP *http.Client + func NewClient(httpClient *http.Client) *Client + func (c *Client) Exchange(ctx context.Context, code string, pkce *PKCE, callbackPort int) (*Token, error) + func (c *Client) Login(ctx context.Context, callbackPort int, openBrowser bool, announce func(string)) (*LoginResult, error) + func (c *Client) Refresh(ctx context.Context, refreshToken string) (*Token, error) + type LoginResult struct + AuthorizeURL string + Token *Token + type Model struct + BehavesAs string + ContextLength int + DefaultEffort string + Description string + DisplayName string + ID string + MaxOutput int + ReasoningLevel []string + SupportsImages bool + func (m Model) ClampEffort(effort string) string + type PKCE struct + Challenge string + Verifier string + func NewPKCE() (*PKCE, error) + type PickerRow struct + BehavesAs string + Description string + Label string + Model string + type Registry struct + func NewRegistry(allow []string, prefix string, variants bool) *Registry + func (r *Registry) AdvertisedIDs() []string + func (r *Registry) BootstrapOptions() []BootstrapOption + func (r *Registry) Lookup(id string) (Model, bool) + func (r *Registry) Models() []Model + func (r *Registry) PickerOptions() []PickerRow + func (r *Registry) Prefix() string + func (r *Registry) Resolve(name string) (Resolution, bool) + type Resolution struct + Effort string + Model Model + Requested string + type Store struct + func NewStore(client *Client, options StoreOptions) *Store + func (s *Store) Access(ctx context.Context) (accessToken, accountID string, err error) + func (s *Store) Authenticated() bool + func (s *Store) NativePath() string + func (s *Store) Path() string + func (s *Store) Peek() (*Token, error) + func (s *Store) Save(token *Token) error + func (s *Store) Sources() []string + type StoreOptions struct + Dir string + ExplicitPath string + UseCodexCLI bool + type Token struct + AccessToken string + AccountID string + Email string + ExpiresAt time.Time + IDToken string + LastRefresh time.Time + PlanType string + RefreshToken string + Type string + func (t *Token) Expired(lead time.Duration) bool