memcode docs
Code

Grok

Run memcode on your SuperGrok or X Premium+ subscription.

If you pay for SuperGrok, or for X Premium+ (which includes Grok), memcode can run on that subscription. No API key, no extra cost.

Connect

memcode auth use grok

Memcode shows a link to approve the sign-in. Open it in any browser, approve, and you're done. The choice is remembered, and memcode keeps you signed in from then on.

This also works on a remote machine or over SSH: open the printed link on your laptop and enter the code shown in the terminal.

Run memcode as usual afterwards. To check what's in use, run memcode auth status. Grok models are selected automatically; pick a specific one with /model.

If Grok replies with "permission denied"

xAI decides which subscription tiers can be used this way, and some accounts are turned away even with an active subscription. If that happens to yours, use an xAI API key instead:

export XAI_API_KEY=xai-...
MEMCODE_ENDPOINT_URL=https://api.x.ai/v1 memcode

Switching away

Run memcode auth any time to pick a different way to sign in.

On this page