Versions in this module Expand all Collapse all v6 v6.9.3 Mar 25, 2026 Changes in this version + const KimiAPIBaseURL + type DeviceCodeResponse struct + DeviceCode string + ExpiresIn int + Interval int + UserCode string + VerificationURI string + VerificationURIComplete string + type DeviceFlowClient struct + func NewDeviceFlowClient(cfg *config.Config) *DeviceFlowClient + func NewDeviceFlowClientWithDeviceID(cfg *config.Config, deviceID string) *DeviceFlowClient + func (c *DeviceFlowClient) PollForToken(ctx context.Context, deviceCode *DeviceCodeResponse) (*KimiTokenData, error) + func (c *DeviceFlowClient) RefreshToken(ctx context.Context, refreshToken string) (*KimiTokenData, error) + func (c *DeviceFlowClient) RequestDeviceCode(ctx context.Context) (*DeviceCodeResponse, error) + type KimiAuth struct + func NewKimiAuth(cfg *config.Config) *KimiAuth + func (k *KimiAuth) CreateTokenStorage(bundle *KimiAuthBundle) *KimiTokenStorage + func (k *KimiAuth) StartDeviceFlow(ctx context.Context) (*DeviceCodeResponse, error) + func (k *KimiAuth) WaitForAuthorization(ctx context.Context, deviceCode *DeviceCodeResponse) (*KimiAuthBundle, error) + type KimiAuthBundle struct + DeviceID string + TokenData *KimiTokenData + type KimiTokenData struct + AccessToken string + ExpiresAt int64 + RefreshToken string + Scope string + TokenType string + type KimiTokenStorage struct + AccessToken string + DeviceID string + Expired string + Metadata map[string]any + RefreshToken string + Scope string + TokenType string + Type string + func (ts *KimiTokenStorage) IsExpired() bool + func (ts *KimiTokenStorage) NeedsRefresh() bool + func (ts *KimiTokenStorage) SaveTokenToFile(authFilePath string) error + func (ts *KimiTokenStorage) SetMetadata(meta map[string]any) v6.9.2-rc1 Mar 25, 2026