{"id":16074939,"url":"https://github.com/zhpd/chatgpt-plus","last_synced_at":"2025-10-22T18:30:50.795Z","repository":{"id":149883532,"uuid":"615562832","full_name":"zhpd/chatgpt-plus","owner":"zhpd","description":"🚀 Open source free ChatGPT App (Web, Mac, Windows and Linux).  免费开源的ChatGPT应用程序. ","archived":false,"fork":false,"pushed_at":"2023-08-09T17:47:16.000Z","size":3519,"stargazers_count":443,"open_issues_count":25,"forks_count":133,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-09T09:02:44.911Z","etag":null,"topics":["chatbot","chatgpt","gpt","vercel","web"],"latest_commit_sha":null,"homepage":"https://chatgpt-plus.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhpd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-18T02:09:11.000Z","updated_at":"2024-10-06T00:55:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"0fbe7bd7-1df8-467d-828b-d9279c3a032a","html_url":"https://github.com/zhpd/chatgpt-plus","commit_stats":null,"previous_names":[],"tags_count":98,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhpd%2Fchatgpt-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhpd%2Fchatgpt-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhpd%2Fchatgpt-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhpd%2Fchatgpt-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhpd","download_url":"https://codeload.github.com/zhpd/chatgpt-plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237727202,"owners_count":19356841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chatgpt","gpt","vercel","web"],"created_at":"2024-10-09T09:01:23.891Z","updated_at":"2025-10-22T18:30:50.323Z","avatar_url":"https://github.com/zhpd.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"/\"\u003e\n    \u003cimg width=\"100\" src=\"https://imgmo.com/images/2023/04/08/298d94cf1fb9dea25ed74e3564a38c40.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eChatGPT-Plus\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nChatGPT-Plus 是使用官方 ChatGPT API 的应用程序。\n\n\u003c!-- ChatGPT-Plus application that uses the official ChatGPT API. --\u003e\n\n[演示 Demo](https://chatgpt-plus.app/) / [反馈 Issues](https://github.com/zhpd/chatgpt-plus/issues) / [开发 Gitpod](https://gitpod.io/#https://github.com/zhpd/chatgpt-plus) / [部署 Vercel](https://vercel.com/new/clone?repository-url=https://github.com/zhpd/chatgpt-plus)\n\n[简体中文](./README.md) | [English](./README_en.md)\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/zhpd/chatgpt-plus)\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zhpd/chatgpt-plus)\n\n\u003cp align=\"center\"\u003e喜欢这个项目吗？请帮忙点个 Star ⭐️\u003cbr/\u003e或者分享给您的朋友，以帮助它得到改善！\u003c/p\u003e\n\n\u003c/div\u003e\n\n![image](https://user-images.githubusercontent.com/11941825/233067531-c3596f30-3d97-436d-9f84-a98fd4498243.png)\n![image](https://user-images.githubusercontent.com/11941825/233068739-953069e2-4a2b-4a01-969b-cb74c2408f02.png)\n![image](https://user-images.githubusercontent.com/11941825/233067913-262307a5-c9c1-45db-9486-324a371e5176.png)\n![image](https://user-images.githubusercontent.com/11941825/233068104-0ce06c11-0e11-4b05-942e-34c457d8a044.png)\n![image](https://user-images.githubusercontent.com/11941825/233067552-14594bf4-3e5e-4b55-b768-a986bd63abbf.png)\n\n\n\u003c!-- | [Spanish](./README-sp_MX.md) | [日本語](./README-ja_JP.md) --\u003e\n\n\u003c!-- \u003e 声明：此项目只发布于 Github，基于 MIT 协议，免费且作为开源学习使用。 --\u003e\n\n# Features\n\n- [介绍](#介绍)\n- [特性](#特性)\n- [原理](#原理)\n- [在线开发](#在线开发)\n- [安装运行](#安装运行)\n  - [克隆项目](#克隆项目)\n  - [环境配置](#环境配置)\n  - [前端网页](#前端网页)\n  - [后端服务](#后端服务)\n- [打包部署](#打包部署)\n  - [使用 Docker 部署](#打包部署)\n    \u003c!-- - [Docker compose](#docker-compose) --\u003e\n  - [使用 Vercel 部署](#打包部署)\n    \u003c!-- - [Vercel环境变量](#Vercel环境变量) --\u003e\n  - [手动打包](#手动打包)\n    - [前端网页](#前端网页打包)\n    - [后端服务](#后端服务打包)\n- [附加说明](#附加内容)\n- [常见问题](#常见问题)\n- [参与贡献](#参与贡献)\n- [感谢](#感谢)\n- [赞助](#赞助)\n- [License](#License)\n\n## 📖介绍\n\nChatGPT-Plus 客户端是官方 ChatGPT API 的应用程序。该应用程序是对 OpenAI 的[ChatGPT](https://openai.com/blog/chatgpt)的官方 API 的封装应用。\n\n\u003c!-- ChatGPT-Plus client for the official ChatGPT API. This Application is a web wrapper around [ChatGPT](https://openai.com/blog/chatgpt) by [OpenAI](https://openai.com). --\u003e\n\n## ✨特性\n\n- 📦 一个完整的 ChatGPT 客户端。\n- 🚀 使用 Nextjs \u0026 Nestjs 构建，快速启动。\n- 📱 响应式设计，支持移动端访问。\n- 🌈 支持多种主题, 白天/夜间模式。\n- 🌍 国际化支持，目前支持中文和英文。\n- 📦 支持自定义提示词，查看在线推荐提示词\n- 🎨 使用 CSS-in-JS 技术，支持主题定制。\n- 📦 支持 Docker \u0026 Vercel 部署。\n\n## 🔬原理\n\n提供两种方式进行访问，要在 Node.js 中使用此模块，您需要在两种方法之间选择：\n\n| 方法                        | 免费？ | 健壮？  | 质量？                  |\n| --------------------------- | ------ | ------- | ----------------------- |\n| `ChatGPTAPI`                | ❌ 否  | ✅ 是   | ✅️ 真实的 ChatGPT 模型 |\n| `ChatGPTUnofficialProxyAPI` | ✅ 是  | ☑️ 可能 | ✅ 真实的 ChatGPT       |\n\n1. `ChatGPTAPI` - 使用带有官方 OpenAI 聊天完成 API（官方、强大的方法，但不免费）的`gpt-3.5-turbo-0301`模型。您可以覆盖模型、完成参数和系统消息，以完全自定义您的助手。\n\n2. `ChatGPTUnofficialProxyAPI` - 使用非官方代理服务器以绕过 Cloudflare 的方式访问 ChatGPT 的后端 API（使用真实的 ChatGPT，比较轻量级，但依赖第三方服务器且有速率限制）。\n\n这两种方法具有非常相似的 API，因此在它们之间切换应该很简单。\n\n注意：我们强烈建议使用`ChatGPTAPI`，因为它使用 OpenAI 官方支持的 API。在未来的发布版本中，我们可能会停止对`ChatGPTUnofficialProxyAPI`的支持。\n\n\u003e 该请求原理采用的是 [chatgpt-api](https://github.com/transitive-bullshit/chatgpt-api)提供的功能模块.\n\n## 💻在线开发\n\n你可以使用 Gitpod 进行在线开发：\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/zhpd/chatgpt-plus)\n\n或者克隆到本地开发，按照以下步骤进行：\n\n## 🚀安装运行\n\n### 克隆项目\n\n```bash\n# clone the project\ngit clone https://github.com/zhpd/chatgpt-plus.git\n```\n\n\u003e 如果没有 git 环境，可以直接下载 zip 包，解压后进入项目目录\n\n### 环境配置\n\n#### Node v14+\n\n\u003e 本项目基于 Node.js 进行开发，需要 Node.js 14.0+ 环境。Make sure you're using `node \u003e= 18` so `fetch` is available (or `node \u003e= 14` if you install a [fetch polyfill](https://github.com/developit/unfetch#usage-as-a-polyfill)).\n\n#### Api Key / AccessToken\n\n本项目使用的是 OpenAI 官方提供的 API，需要申请 Api Key 和 AccessToken\n\n\u003e - OpenAI 官方注册申请地址：[https://platform.openai.com/](https://platform.openai.com/)，需要科学上网\n\u003e - 通过其他方式获取 `ApiKey` 或 `AccessToken` [点击查看](#附加内容)\n\n申请成功后，将 APIKey 和 AccessToken 填写到 `chatgpt-plus/service/.env` 文件中\n\n#### 可选 VSCode\n\n\u003e 推荐使用 [VSCode](https://code.visualstudio.com/) 编辑器进行开发，安装插件 `ESLint` 和 `Prettier`，并在设置中开启 `Format On Save`\n\n\n### 前端网页\n\n#### 环境变量-前端\n\n配置端口和接口请求地址在根目录.env 里。\n可直接复制根目录下的.env.example 文件进行修改，文件名修改为.env）\n\n| 环境变量名            | 默认值                  | 说明     |\n| --------------------- | ----------------------- | -------- |\n| `PORT`                | `3000`                  | 端口     |\n| `NEXT_PUBLIC_API_URL` | `http://localhost:3002` | 接口地址 |\n\n\u003cdetails\u003e\n\u003csummary\u003e 配置文件\u003c/summary\u003e\n\n可直接复制根目录下的.env.example 文件进行修改，文件名修改为.env\n\n```env\n# port\nPORT=3000\n\n# api url\nNEXT_PUBLIC_API_URL=http://localhost:3002\n\n```\n\n\u003c/details\u003e\n\n#### 运行代码\n\n```bash\n# enter the project directory\ncd chatgpt-plus\n# install dependency\nnpm install\n# develop\nnpm run dev\n```\n\n\u003e 运行启动成功后，可在浏览器打开 http://localhost:3000 查看效果\n\n### 后端服务\n\n#### 环境变量-后端\n\n配置端口和 ApiKey、AccessToken 在 service 目录下.env 里\n\n| 环境变量名            | 默认值                                            | 说明                                      |\n| --------------------- | ------------------------------------------------- | ----------------------------------------- |\n| `PORT`                | `3002`                                            | 端口                                      |\n| `OPENAI_API_KEY`      | -                                                 | [API_KEY](#获取密钥-api-key)              |\n| `OPENAI_ACCESS_TOKEN` | -                                                 | [ACCESS_TOKEN](#获取访问令牌-accesstoken) |\n| `API_REVERSE_PROXY`   | `https://api.pawan.krd/backend-api/conversation` | [代理](#反向代理)                         |\n| `TIMEOUT_MS`          | 60000                                             | 超时毫秒数                                |\n\n\u003cdetails\u003e\n\u003csummary\u003e 配置文件\u003c/summary\u003e\n\n可直接复制 service 目录下的.env.example 文件进行修改，文件名修改为.env\n\n```env\n# service/.env\n# OpenAI API Key - https://platform.openai.com/overview\nOPENAI_API_KEY=\n\n# change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response\nOPENAI_ACCESS_TOKEN=\n\n# Reverse Proxy default 'https://bypass.churchless.tech/api/conversation'\nAPI_REVERSE_PROXY=\n\n# timeout\nTIMEOUT_MS=100000\n\n```\n\n\u003c/details\u003e\n\n#### 运行代码\n\n```bash\n# enter the project directory\ncd chatgpt-plus\n# enter the service directory\ncd service\n# install dependency\nnpm install\n# develop\nnpm run dev\n```\n\n\u003e 运行启动成功后，后端服务便可正常运行\n\n## 📦打包部署\n\n### Docker\n\n使用Docker方式部署，需要安装Docker环境\n#### Docker 参数示例\n\n使用docker-compose文件夹内的配置文件，进行拉取运行即可\n\n### Vercel\n\n使用Vercel进行部署，可一键部署\n#### Vercel环境变量\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/zhpd/chatgpt-plus)\n\n### 手动打包\n\n#### 前端网页打包\n\n- 代码打包\n  - 进入项目根文件夹\n  - 修改根目录下 `.env` 文件中的 `API_URL` 为你的实际后端接口公网地址\n  - 运行 `npm install` 安装依赖\n  - 运行 `npm run build` 打包代码\n- 运行部署\n  - 将 `dist` 文件夹内的文件复制到你网站 `前端服务` 的目录下\n  - 进入 `dist` 文件夹\n  - 运行 `npm run start` 启动服务\n\n#### 后端服务打包\n\n- 代码打包\n  - 进入 `service` 文件夹\n  - 运行 `npm install` 安装依赖\n  - 运行 `npm run build` 打包代码\n- 运行部署\n  - 将 `service/dist` 文件夹内的文件复制到你网站 `后端服务` 的目录下\n  - 进入 `service/dist` 文件夹\n  - 运行 `npm run start` 启动服务\n\n\u003e **备注**: 如果不想进行打包，可以直接复制 `service`文件夹 到服务器上运行 `npm install` 和 `npm run start` 也可以启动服务\n\n## ℹ️附加内容\n\n### 获取密钥 API Key\n\n\u003cdetails\u003e\n\u003csummary\u003e配置文件\u003c/summary\u003e\n\n您可以通过给后端服务.env 配置`OPENAI_API_KEY`密钥进行访问：\n\n```env\n# R OpenAI API Key\nOPENAI_API_KEY =\n```\n\n\u003c/details\u003e\n\n本项目使用的是 OpenAI 官方提供的 API，需要先申请 OpenAI 账号\n\n- OpenAI 官方注册申请地址：[https://platform.openai.com/](https://platform.openai.com/)，需要科学上网\n- 注册成功后，通过[https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys) 获取 API Key，需要科学上网\n\n### 获取访问令牌 accessToken\n\n\u003cdetails\u003e\n\u003csummary\u003e配置文件\u003c/summary\u003e\n\n您可以通过给后端服务.env 配置`OPENAI_ACCESS_TOKEN`访问令牌访问：\n\n```env\n# change this to an `accessToken` extracted from the ChatGPT\nOPENAI_ACCESS_TOKEN =\n```\n\n\u003c/details\u003e\n\n您需要从 ChatGPT Web 应用程序获取一个 OpenAI 访问令牌。您可以使用以下任何方法之一，这些方法需要一个`email`和`password`，并返回一个访问令牌：\n\n- - Node.js 库\n  - [ericlewis/openai-authenticator](https://github.com/ericlewis/openai-authenticator)\n  - [michael-dm/openai-token](https://github.com/michael-dm/openai-token)\n  - [allanoricil/chat-gpt-authenticator](https://github.com/AllanOricil/chat-gpt-authenticator)\n\n- - Python 库\n  - [acheong08/OpenAIAuth](https://github.com/acheong08/OpenAIAuth)\n\n_这些库与使用电子邮件和密码进行身份验证的帐户配合使用（例如，它们不支持通过 Microsoft / Google 进行身份验证的帐户）。_\n\n另外，您可以通过登录 ChatGPT Web 应用程序并打开`https://chat.openai.com/api/auth/session`来手动获取一个`accessToken`，该链接将返回一个 JSON 对象，其中包含您的`accessToken`字符串。\n\n_访问令牌有效期为数天。_\n\n\u003e _注意_：使用反向代理将使您的访问令牌暴露给第三方。这不会产生任何不利影响，但在使用此方法之前，请考虑风险。\n\n### 反向代理\n\n\u003cdetails\u003e\n\u003csummary\u003e配置文件\u003c/summary\u003e\n\n您可以通过给后端服务.env 配置`API_REVERSE_PROXY`代理地址覆盖反向代理：\n\n```env\n# Reverse Proxy\nAPI_REVERSE_PROXY =\n```\n\n\u003c/details\u003e\n\n社区成员运行的已知反向代理包括：\n\n| 反向代理 URL                                      | 作者                                         | 速率限制                     | 最后检查日期 |\n| ------------------------------------------------- | -------------------------------------------- | ---------------------------- | ------------ |\n| `https://bypass.churchless.tech/api/conversation` | [@acheong08](https://github.com/acheong08)   | 5 req / 10 seconds by IP     | 3/24/2023    |\n| `https://api.pawan.krd/backend-api/conversation`  | [@PawanOsman](https://github.com/PawanOsman) | 50 req / 15 seconds (~3 r/s) | 3/23/2023    |\n\n注：目前不公布反向代理工作方式的信息，以防止 OpenAI 禁用访问。\n\n## ❓常见问题\n\nQ: 如果只使用前端页面，在哪里改请求接口？\n\nA: 根目录下 `.env` 文件中的 `API_URL` 字段。\n\nQ: 前端没有打字机效果？\n\nA: 一种可能原因是经过 Nginx 反向代理，开启了 buffer，则 Nginx 会尝试从后端缓冲一定大小的数据再发送给浏览器。请尝试在反代参数后添加 `proxy_buffering off;`，然后重载 Nginx。其他 web server 配置同理。\n\n## 🤝参与贡献\n\n\u003c!-- 贡献之前请先阅读 [贡献指南](./CONTRIBUTING.md) --\u003e\n\n感谢所有做过贡献的人!\n\n\u003ca href=\"https://github.com/zhpd/chatgpt-plus/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=zhpd/chatgpt-plus\" /\u003e\n\u003c/a\u003e\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=zhpd/chatgpt-plus\u0026type=Date)](https://star-history.com/#zhpd/chatgpt-plus\u0026Date)\n\n\n## 🙏感谢\n\n- 非常感谢项目支持者和所有其他贡献者 💪\n- 非常感谢最初构建的参考项目[@transitive-bullshit](https://github.com/transitive-bullshit)的[chatgpt-api](https://github.com/transitive-bullshit/chatgpt-api)和[@Chanzhaoyu](https://github.com/Chanzhaoyu)的[chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web)提供的思路。👍\n- 非常感谢[OpenAI](https://openai.com) 创建的 [ChatGPT](https://openai.com/blog/chatgpt/) 🔥\n\n## 💰赞助\n\n如果您觉得本项目对您有帮助，可以帮忙点个 Star ⭐️，或者分享给您的朋友，您的支持是我最大的动力！\n\n## 📜License\n\nMIT © [zhpd](./license)\n","funding_links":[],"categories":["Web 应用"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhpd%2Fchatgpt-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhpd%2Fchatgpt-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhpd%2Fchatgpt-plus/lists"}