Reverse-engineering ChatGPT's image API for your own private pool
A self-hosted proxy that turns ChatGPT's web-only image generation into an OpenAI-compatible API with account rotation and web UI.

What it does
ChatGPT2API reverse-engineers ChatGPT’s web interface to expose its image generation, editing, and multi-image composition through standard OpenAI-compatible endpoints (/v1/images/generations, /v1/images/edits, plus chat-completion and responses shims for image workflows). It bundles a web-based drawing studio, account pool management, and Docker deployment so you can run your own relay rather than hitting official APIs directly.
The interesting bit
The project treats account scarcity as a first-class problem: it maintains a rotating pool of ChatGPT accounts, auto-refreshes quotas and recovery times, drops dead tokens, and can re-login failed accounts. You can bulk-import credentials from CPA JSON files, remote CPA servers, sub2api pools, or raw access tokens. The “Codex” image endpoint is also reverse-engineered, giving Plus/Team/Pro subscribers a second parallel image quota under the alias codex-gpt-image-2.
Key highlights
- OpenAI-compatible REST API for
gpt-image-2and related models, including edits with reference-image uploads or URL references - Built-in web UI for generation, editing, and multi-image composition with session history and lazy-loaded galleries
- Account pool manager with proxy support (HTTP/HTTPS/SOCKS5), auto-culling of expired tokens, and scheduled rate-limit recovery checks
- Storage backends: local JSON, SQLite, PostgreSQL, or Git repository
- Generates editable PPT and PSD files, not just static images
- Docker images for
linux/amd64andlinux/arm64
Caveats
- Explicitly a reverse-engineering project; the README warns repeatedly of ban risk and prohibits commercial use, bulk automation, or resale
- Text completion (
/v1/complete) and streaming are marked experimental with known dialogue-repetition bugs - The chat-completion and responses endpoints are image-scene-only shims, not general conversational proxies
Verdict
Worth a look if you operate multiple ChatGPT accounts and want a self-hosted, pool-aware image API for tools like Cherry Studio or New API. Skip it if you need reliable text chat, fear ToS enforcement, or prefer officially supported infrastructure.