Status: [UNTESTED] Endpoints found: http://127.0.0.1:8080/v1/chat/completions Source: https://github.com/itsmepicus/Grok-reverse-proxy # Grok Reverse Proxy
## English A small, self-contained reverse proxy for a Grok CLI OAuth session. It exposes OpenAI- and Anthropic-compatible endpoints while using the Grok Responses API upstream. The repository contains no account data, tokens, cookies, or request history. Runtime credentials stay on the machine where the proxy runs. > This is an unofficial community project. It is not affiliated with xAI. > Use it only with accounts you control and in accordance with the applicable > xAI terms and policies. Upstream endpoints and model names can change. ### Features - `POST /v1/chat/completions` — OpenAI Chat Completions, including SSE streaming. - `POST /v1/responses` — OpenAI Responses passthrough. - `POST /v1/messages` — Anthropic Messages compatibility, including streaming. - `GET /v1/models` and unauthenticated `GET /healthz`. - Grok model aliases (`grok-build` → `grok-4.6`, pinned `grok-4.5`, Composer aliases). - Tool calls, reasoning effort normalization, usage conversion, and images. - Automatic OAuth refresh with atomic owner-only runtime persistence. - Multiple account files with least-loaded selection, cooldowns, and retries. - Mandatory API-key protection whenever the service listens beyond loopback. - Standard-library-only Go binary, Docker image, tests, and GitHub Actions CI. ### Quick start Requirements: Go 1.23+ and a valid session created by the official `grok` CLI. ```bash grok login cp .env.example .env ``` Replace `GROK_PROXY_API_KEY` in `.env` with a random secret: ```bash openssl rand -hex 32 set -a; source .env; set +a go run ./cmd/grok-reverse-proxy ``` The default credential path is `~/.grok/auth.json`; the file is read directly and is never copied into this repository. The proxy writes refreshed tokens to the ignored `./data/accounts.json` with filesyste