webchat2api is a proxy server that takes the browser-based chat interfaces of ChatGPT and Grok and exposes them as a standard OpenAI-style API. The idea is that if you already have a web login for ChatGPT or Grok, this project lets you call those chats from your own code using the same endpoints that other tools use to talk to the official OpenAI API, things like /v1/models, /v1/chat/completions, and /v1/images/generations. The README opens with a clear warning. The project is reverse-engineering the web chat experience, and it is meant for personal learning and non-commercial technical exploration. The author tells users not to use it for reselling or any large-scale abuse, and to accept that accounts may get rate-limited or banned. There is also a security note that the default login password is admin, which is only fine for local testing. For any public deployment you have to set a strong LOGIN_SECRET or WEBCHAT2API_AUTH_KEY. The stack is FastAPI on the backend and a Next.js admin web app on top of it. The admin panel manages a pool of GPT and Grok accounts, user API keys, proxy settings, logs, image jobs, files, and overall system config. There is also a playground page for trying chat and image generation, with separate text-to-image and image-to-image modes, plus an image queue and history. When generating images, if one account fails the service rotates to the next available one. Getting started is built around Docker. You clone the repo, build the image, and run a docker container that exposes port 83 with a data volume for persistence. There is a second example that adds a proxy URL pointing to the host machine, useful when you need to tunnel out through your own network. Docker Compose is also supported, and there are commands for local development with uv for the Python side and npm run dev for the web frontend. The API examples in the README show how to call /health, list models, chat, and generate images using a Bearer token. Configuration lives in a .env file and a config.json that you copy from the example. Storage can be plain JSON files, SQLite, Postgres, or even Git as a backend. The data folder holds accounts, keys, logs, and image tasks, and the README is firm that this folder must never be committed to version control.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.