← all repositories
basketikun/chatgpt2api

Self-hosted proxy that farms ChatGPT image quotas across account pools

It turns ChatGPT’s browser-only image generation into a poolable, OpenAI-compatible API so you can self-host programmatic access to GPT-Image-2 and friends.

chatgpt2api
Velocity · 7d
+13
★ / day
Trend
cooling
star history

What it does

ChatGPT2API is a reverse-engineered proxy that exposes ChatGPT’s web-native image generation and editing—including GPT-Image-2 and Codex drawing—through standard OpenAI-compatible endpoints. It bundles a web-based drawing board, account-pool orchestration, and pluggable storage backends ranging from local JSON to PostgreSQL. Think of it as a translation layer between your apps and OpenAI’s browser-only features, with a built-in account rotator to keep requests flowing.

The interesting bit

The real machinery isn’t the API compatibility; it’s the account pool manager. The system imports credentials from CPA JSON dumps, sub2api servers, or raw access tokens, then automatically refreshes quotas, culls dead tokens, and retries through SOCKS proxies. It turns a handful of disposable ChatGPT accounts into a single logical image-generation endpoint, complete with progress tracking and server-side URL caching.

Key highlights

  • OpenAI-compatible endpoints for image generation, editing, and chat-formatted image requests (/v1/images/generations, /v1/images/edits, /v1/chat/completions for images)
  • Supports GPT-Image-2, Codex drawing (Plus/Team/Pro only), and several GPT-5 variants, plus exotic outputs like editable PPT and PSD files
  • Built-in web UI for drawing, editing, and multi-image composition with session history and lazy loading
  • Account pool automation: imports from CPA/sub2api, auto-refreshes quotas, evicts invalid tokens, and supports global proxy configuration
  • Pluggable storage backends: local JSON, SQLite, PostgreSQL, or even a private Git repository

Caveats

  • This is explicitly reverse-engineering; the README warns that accounts face “restricted, temporary or permanent ban” risks and prohibits commercial use
  • Text completion and streaming via /v1/complete and /v1/chat/completions are experimental and currently suffer from conversation repetition
  • Codex drawing support requires Plus/Team/Pro subscriptions and aliases a separate model (codex-gpt-image-2)

Verdict

Worth a look if you’re running a self-hosted AI stack and need programmatic access to ChatGPT’s web-only image tricks—provided you have spare accounts to burn. Everyone else should probably wait for an official API.

Frequently asked

What is basketikun/chatgpt2api?
It turns ChatGPT’s browser-only image generation into a poolable, OpenAI-compatible API so you can self-host programmatic access to GPT-Image-2 and friends.
Is chatgpt2api open source?
Yes — basketikun/chatgpt2api is open source, released under the MIT license.
What language is chatgpt2api written in?
basketikun/chatgpt2api is primarily written in Python.
How popular is chatgpt2api?
basketikun/chatgpt2api has 5.2k stars on GitHub and is currently cooling off.
Where can I find chatgpt2api?
basketikun/chatgpt2api is on GitHub at https://github.com/basketikun/chatgpt2api.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.