Quick Start

This guide turns an xAI account session into a local Grok tool surface. After login, progrok can either run an OpenAI-compatible proxy for existing clients or call xAI endpoints directly through purpose-built CLI commands.

What you are activating

You are not creating a new API key. You are authorizing progrok to hold a refreshable xAI OAuth session locally, then using that session to power SDKs, agent tools, search commands, image jobs, video jobs, and model discovery.

1. Install

npm install -g progrok

Node 18 or newer is required. The CLI is ESM-only and runs locally.

2. Login with xAI OAuth

progrok login

The browser flow signs in with your xAI account and stores the refreshed session at ~/.progrok/auth.json. On SSH boxes, remote shells, or machines without a browser, use the device-code flow:

progrok login --device-code

3. Confirm the session

progrok status

This confirms whether progrok can load a bearer token, whether the session has an expiry, and which account email is present when xAI returns one.

4. Start the proxy

progrok proxy

The proxy listens on 127.0.0.1:18645 by default and forwards /v1/* requests to https://api.x.ai/v1/*. Any bearer token sent by the client is treated as a placeholder and replaced with the stored xAI OAuth token.

5. Point a client at localhost

curl http://127.0.0.1:18645/v1/chat/completions \
  -H "Authorization: Bearer anything" \
  -H "Content-Type: application/json" \
  -d '{"model":"grok-4.3","messages":[{"role":"user","content":"Hello from progrok"}]}'

Most OpenAI-compatible SDKs need only two settings: base_url=http://127.0.0.1:18645/v1 and a non-empty placeholder API key.

6. Use direct tool commands

The proxy is not required for commands that progrok owns directly. These commands load the same OAuth session and call xAI with task-specific handling.

progrok search --x --json "Grok Build release discussion"
progrok image "terminal product shot for an OAuth bridge CLI" --output ./out
progrok video "short animation of a local proxy activating Grok tools" --duration 5
progrok models --detail
progrok capabilities --json

7. Understand the boundary

  • Your xAI account and subscription still control access.
  • progrok does not bypass quotas, billing, product gates, or model availability.
  • The local credential should be protected like any other account credential.
  • The proxy is local by default; do not bind it publicly without your own access controls.