progrok proxy
progrok proxy turns the stored OAuth session into an
OpenAI-compatible local endpoint. It is the bridge for clients that already know
how to call OpenAI-shaped APIs but do not know how to perform xAI OAuth.
Start the server
progrok proxy --host 127.0.0.1 --port 18645
The default bind address is 127.0.0.1 and the default port is
18645. Keep it on localhost unless you are deliberately placing
your own authentication and network controls in front of it.
Client configuration
export OPENAI_BASE_URL=http://127.0.0.1:18645/v1
export OPENAI_API_KEY=anything The placeholder API key only satisfies client libraries that require a value. progrok discards that bearer token and injects the refreshed xAI OAuth token before the upstream request leaves your machine.
Proxy behavior
POST http://127.0.0.1:18645/v1/chat/completions
Authorization: Bearer anything
progrok:
1. loads ~/.progrok/auth.json
2. refreshes the token if needed
3. replaces Authorization with the xAI OAuth bearer
4. forwards to https://api.x.ai/v1/chat/completions What paths are covered
The proxy forwards HTTP /v1/* paths, so the same local endpoint can
be used for chat, Responses, reasoning, structured output, tool calls, files,
batches, tokenizer requests, model listing, images, videos, voice endpoints, and
collection search when your account has access.
When not to use the proxy
Use direct commands when progrok provides a richer workflow than a generic HTTP forwarder:
progrok searchfor web/X source selection, JSON output, and reasoning effort.progrok imagefor local reference files and output handling.progrok videofor async job polling and downloads.progrok capabilities --jsonfor agent-readable metadata.