Documentation
¶
Overview ¶
Package grok turns a SuperGrok / X Premium+ subscription into a memcode backend via xAI's OAuth device-code flow. Unlike the claude/codex/copilot sources, there is no other tool's login to reuse: memcode runs the login itself (accounts.x.ai device code, the flow the grok CLI client is registered for) and owns the token file. The resulting bearer token drives api.x.ai/v1 through the shared Grok Responses adapter unchanged.
Consent-gated upstream like every subscription source: it activates only when the user explicitly selects the grok source, and the login itself is an interactive approval in the user's browser.
Index ¶
Constants ¶
const (
// BaseURL is the xAI inference host the subscription token is valid for.
BaseURL = "https://api.x.ai/v1"
)
Variables ¶
var ErrTierGated = errors.New("this xAI account's subscription tier is not allowed API access over OAuth — set XAI_API_KEY instead, or upgrade at x.ai/grok")
ErrTierGated marks a 403 from the token endpoint: the OAuth grant is valid but xAI's backend does not allow API access for this subscription tier. Re-logging in won't change it; the fix is an XAI_API_KEY or a higher tier.
Functions ¶
func Available ¶
func Available() bool
Available reports whether a Grok login is stored, for the wizard's menu (no parse, no network).
Types ¶
This section is empty.