explaingit

remotepinee/chatgpt2api

16TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

ChatGPT2API is a self-hosted server that reverse-engineers the ChatGPT web interface and exposes its image generation and text features through standard OpenAI-compatible API endpoints, with account pool rotation and a web panel.

Mindmap

mindmap
  root((chatgpt2api))
    What it does
      OpenAI-compatible API
      Image generation
      Text completions
    Account pool
      Multi-account rotation
      Token expiry handling
      Auto-registration
    Storage options
      SQLite
      PostgreSQL
      Git repository
    Deployment
      Docker x86 and ARM
      Web panel
      Android companion app
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a private API server that lets your apps generate images and text using pooled ChatGPT accounts without paying for the official OpenAI API.

USE CASE 2

Manage multiple ChatGPT accounts in a rotating pool that automatically removes expired tokens and handles rate limits.

USE CASE 3

Build a browser-based image studio where users can generate and edit images backed by your account pool.

Tech stack

TypeScriptDockerSQLitePostgreSQL

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires Docker and multiple ChatGPT accounts, using this tool violates OpenAI's terms of service and risks permanent account bans.

In plain English

ChatGPT2API is a self-hosted server that wraps around ChatGPT's web interface using reverse-engineering techniques to expose image generation and text capabilities through API endpoints that follow the OpenAI format. It builds on an earlier open-source project called chatgpt2api, adding a redesigned web panel, account management tools, and additional features on top of the original core. The server exposes several API endpoints compatible with the OpenAI standard, including image generation from text prompts, image editing from uploaded files, and text completions. It also supports a format compatible with Anthropic's API. Because it reverse-engineers the ChatGPT web interface rather than using the official API, the available image models and quotas depend on the ChatGPT account permissions of whichever accounts you load into the system. A central feature is account pool management: you can load multiple ChatGPT accounts into the server, and it rotates through them when handling requests, automatically removing accounts whose tokens have expired or been rate-limited. Accounts can be imported in several ways, including from local files or a remote sub2api service. There is also a built-in account registration pipeline for creating new accounts. The web panel includes an online image studio for generating and editing images through a browser interface. You can view logs by type and date range, browse and manage cached images, and configure storage. Storage options include local JSON files, SQLite, PostgreSQL, and a private Git repository. Docker deployment is supported on both x86 and ARM hardware. A companion Android app called Draw is distributed as a closed-source APK and connects to the same backend for image generation, a community gallery, and saved works management. The README carries prominent warnings: using this tool violates OpenAI terms of service, risks account bans, and is restricted to personal study and non-commercial technical use. The project advises against using primary or high-value accounts.

Copy-paste prompts

Prompt 1
I'm setting up chatgpt2api with Docker. Help me configure a pool of ChatGPT accounts and set up automatic token rotation so expired accounts are removed.
Prompt 2
Show me how to call chatgpt2api's image generation endpoint from a Node.js app using the OpenAI SDK format.
Prompt 3
Help me configure chatgpt2api to use PostgreSQL storage instead of local JSON files and set up the database schema.
Prompt 4
I want to import ChatGPT accounts into chatgpt2api from a local file. What format does the import file need to be in?
Open on GitHub → Explain another repo

← remotepinee on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.