Versions in this module Expand all Collapse all v1 v1.1.0 Jul 16, 2026 Changes in this version + type Option func(*Kagi) + func WithClient(client *http.Client) Option + func WithUserAgent(userAgent string) Option v1.0.0 Jul 10, 2026 Changes in this version + const DefaultUserAgent + var ErrEmptyResponse = errors.New("empty response") + func OneShot(ctx context.Context, token, from, to, text string) (string, error) + type AuthResponse struct + AccountType string + CustomCSSAvailable bool + CustomCSSEnabled bool + ExpiresAt time.Time + ID string + Language string + LoggedIn bool + MobileTheme string + Platform string + Subscription bool + Theme string + Token string + type DetectParams struct + IncludeAlternatives bool + RecentLanguages []string + SessionToken string + Text string + type DetectResponse struct + Alternatives []Language + DetectedLanguage Language + type Kagi struct + func New(token string) *Kagi + func (kt *Kagi) Detect(ctx context.Context, text string) (DetectResponse, error) + func (kt *Kagi) DetectWithParams(ctx context.Context, params DetectParams) (DetectResponse, error) + func (kt *Kagi) Quota(ctx context.Context) (QuotaResponse, error) + func (kt *Kagi) Translate(ctx context.Context, from, to, text string) (TranslateResponse, error) + func (kt *Kagi) TranslateWithParams(ctx context.Context, params TranslateParams) (TranslateResponse, error) + func (kt *Kagi) WithClient(client *http.Client) *Kagi + func (kt *Kagi) WithUserAgent(userAgent string) *Kagi + type Language struct + Iso string + Label string + type Quota struct + ActiveJobID *string + Exceeded bool + Exempt bool + Kind string + Limit int + Percent float64 + Remaining int + ResetsAt time.Time + Used int + type QuotaResponse struct + Document Quota + Proofread Quota + Translate Quota + type TranslateParams struct + AddresseeGender string + Context string + DictionaryLanguage string + EnableLanguageFeatures bool + Formality string + From string + LanguageComplexity string + Model string + PredictedLanguage string + SessionToken string + SpeakerGender string + Stream bool + Text string + To string + TranslationStyle string + UseDefinitionContext bool + type TranslateResponse struct + Definition struct{ ... } + DetectedLanguage Language + Translation string