gitmyhub

ChatGPT2API

TypeScript ★ 151 updated 8d ago

基于chatgpt2api二开版本

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.

TypeScriptDockerSQLitePostgreSQLsetup: moderatecomplexity 3/5

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.

Where it fits