Versions in this module Expand all Collapse all v1 v1.103.0 Jul 9, 2026 v1.102.0 Jul 8, 2026 Changes in this version + const BaseURL + const Originator + const ProviderName + const TokenEnvVar + var ErrNotLoggedIn = errors.New("not signed in with a ChatGPT account") + func AccessToken(ctx context.Context) (string, error) + func AccountIDFromToken(token string) string + func LoggedIn() bool + func Logout() (bool, error) + func SetCredentialsPathForTests(path string) (restore func()) + type Credentials struct + AccessToken string + AccountID string + Email string + ExpiresAt time.Time + IDToken string + LastRefresh time.Time + Plan string + RefreshToken string + func Load() (*Credentials, error) + func (c *Credentials) Expired() bool + type LoginResult struct + AccountID string + Email string + Plan string + func Login(ctx context.Context, out io.Writer) (*LoginResult, error)