basketikun/chatgpt2api
AI EngineeringReverse-engineers ChatGPT's web endpoints into an OpenAI-compatible API for image, text, and voice tasks with account-pool management.
What it does
ChatGPT2API wraps reverse-engineered ChatGPT web endpoints in an OpenAI-compatible HTTP API. It is written in Go and targets image generation, image editing, multi-image composition, text models with web search, and speech synthesis/transcription. The service also ships a web console for prompting and image work, plus an account-pool manager that rotates ChatGPT accounts and removes tokens that fail.
The project is meant for people who already hold ChatGPT subscriptions and want to call those capabilities through OpenAI-style /v1/images/generations, /v1/images/edits, /v1/chat/completions, /v1/responses, /v1/audio/speech, and /v1/audio/transcriptions routes, for example from Cherry Studio or New API.
Quick start
Prepare Docker and a ChatGPT account login that can be imported into the pool. Clone the repository, set an api-key in config.yaml (or override it with CHATGPT2API_AUTH_KEY in .env), then start the stack:
git clone git@github.com:basketikun/chatgpt2api.git
cd chatgpt2api
docker compose up -d
The web panel is at http://localhost:3000, the API base is http://localhost:3000/v1, and data is written to ./data. After importing an account through one of the pool import paths, call the API with Authorization: Bearer <api-key>:
curl http://localhost:3000/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <api-key>" \
-d '{
"model": "gpt-image-2.6",
"prompt": "a cat floating in space",
"n": 1,
"response_format": "b64_json"
}'
For local development, run go run . in the repository root; the frontend lives under web/ and does not need a build step. Deployment and upgrade notes are in docs/deployment.md. Note that the README's cURL examples use port 8000 while the quick-start section says 3000; use whichever port your deployment actually exposes.
Account and model constraints
Every AI route requires a valid API key header. Image generation and editing are limited to n between 1 and 4, and size values are converted to the upstream aspect_ratio. Speech synthesis needs a Plus/Team/Pro login with voice access. Codex-based image generation is also restricted to Plus/Team/Pro subscriptions; the model name stays gpt-image-2.6 externally, and the subscription tier and route (Web or Codex) are selected per user key.
The chat/completions and responses routes cover text, web search, and image scenarios but are explicitly not full general-purpose chat or Responses proxies. Streaming on text, search, and image paths is implemented but still marked as under testing. The account pool supports local CPA JSON import, remote CPA server import, sub2api server import, and access_token import, and can be configured with HTTP/HTTPS/SOCKS5/SOCKS5H proxies, WARP, or FlareSolverr.
Risk and license
The README states that the project is built on reverse engineering of ChatGPT web interfaces and is intended for personal study and non-commercial technical exchange only. It warns that accounts used with it may be rate-limited, temporarily banned, or permanently banned, and advises against using important or high-value accounts. The repository is MIT-licensed, but that license does not grant rights to OpenAI's services or override OpenAI's terms of service.
HotRepo's take
The project entered the Go daily list on 2026-11-17 at position 13, with 6,926 stars and 1,754 forks recorded that day. That is a single snapshot rather than a trend line, but the fork-to-star ratio is high for a utility of this kind, which is consistent with a proxy that people deploy and modify locally. The README's sponsor block (AI image platforms, an API reseller, a residential proxy provider, and an inference cloud) also shows the project is being used as a distribution channel, not just a code drop. The main practical trade-off is that the API surface is deliberately narrow and tied to reverse-engineered web endpoints, so users should expect model availability and account behavior to shift with ChatGPT's own changes.
Written by AI from the project's README, updated . The project's own docs are the source of truth.
You might also like
- yang0/chatgpt2api-dshRuns a local ChatGPT account pool and exposes an OpenAI-compatible API for desktop AI clients and image generation.
- router-for-me/CLIProxyAPITurns CLI coding subscriptions into OpenAI, Gemini or Claude-compatible API endpoints for existing apps and SDKs.
- Wei-Shaw/sub2apiSelf-hosted AI API gateway that turns subscription accounts into managed, metered API keys.
- tashfeenahmed/freellmapiOne OpenAI-compatible endpoint that pools free tiers from 34 LLM providers with routing and failover, for hobby experiments.
- linguo2625469/workbuddy2api-panelSelf-hosted OpenAI-compatible gateway that pools CodeBuddy accounts and automates growth tasks, with an admin panel.