{"id":13646304,"url":"https://github.com/xcatliu/chatgpt-next","last_synced_at":"2025-05-15T01:09:27.474Z","repository":{"id":143568829,"uuid":"614718071","full_name":"xcatliu/chatgpt-next","owner":"xcatliu","description":"微信风格的 ChatGPT，使用 Next.js 构建，私有化部署的最佳选择！","archived":false,"fork":false,"pushed_at":"2025-01-03T08:48:21.000Z","size":3514,"stargazers_count":775,"open_issues_count":7,"forks_count":262,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-15T00:46:27.707Z","etag":null,"topics":["chatgpt","nextjs","wechat"],"latest_commit_sha":null,"homepage":"https://chatgpt-next.com","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/xcatliu.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2023-03-16T07:08:43.000Z","updated_at":"2025-04-14T03:34:01.000Z","dependencies_parsed_at":"2023-11-22T13:42:25.378Z","dependency_job_id":"0a1c852c-e1c8-42f7-a372-4188e4644008","html_url":"https://github.com/xcatliu/chatgpt-next","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcatliu%2Fchatgpt-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcatliu%2Fchatgpt-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcatliu%2Fchatgpt-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcatliu%2Fchatgpt-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcatliu","download_url":"https://codeload.github.com/xcatliu/chatgpt-next/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254043,"owners_count":22039792,"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":["chatgpt","nextjs","wechat"],"created_at":"2024-08-02T01:02:52.548Z","updated_at":"2025-05-15T01:09:22.459Z","avatar_url":"https://github.com/xcatliu.png","language":"TypeScript","funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  ChatGPT Next\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e\n  微信风格的 ChatGPT，基于 Next.js 构建，私有化部署的最佳选择！\n\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://chatgpt-next.com\"\u003e官方网站\u003c/a\u003e已被墙 [\u003ca href=\"https://1.caninae.com\"\u003e镜像\u003c/a\u003e]\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u003ca href=\"#私有化部署\"\u003e私有化部署\u003c/a\u003e\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u003ca href=\"#配置\"\u003e配置\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chatgpt-next\"\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/chatgpt-next\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/server.yml\"\u003e\n    \u003cimg src=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/server.yml/badge.svg\" alt=\"server\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/docker.yml\"\u003e\n    \u003cimg src=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/docker.yml/badge.svg\" alt=\"docker\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/test.yml\"\u003e\n    \u003cimg src=\"https://github.com/xcatliu/chatgpt-next/actions/workflows/test.yml/badge.svg\" alt=\"test\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 特性\n\n- 🎉 支持 o1 和 o1-mini 啦\n- 🎉 支持 gpt-4o 和 gpt-4o-mini 啦\n- 微信风格的聊天气泡，支持移动/PC 端，打造最极致的交互体验\n- 支持私有化部署，使用 [Vercel](#使用-vercel-一键部署) / [Zeabur](#使用-zeabur-一键部署) / [netlify](#使用-netlify-一键部署) 等一键部署\n- 配置密钥别名，无需暴露 apiKey 就可以分享给朋友\n\n\u003cimg src=\"https://raw.githubusercontent.com/xcatliu/chatgpt-next/main/public/screenshot-wechat.png\" width=\"390\"\u003e\n\n## 官方网站被墙通知\n\n如果无法访问官方网站 [https://chatgpt-next.com](https://chatgpt-next.com)，可以尝试访问镜像站 [https://1.caninae.com](https://1.caninae.com)，或者[备份网址](#备份网址)，或者私有化部署。\n\n## 私有化部署\n\n私有化部署时，域名最好不要带 chat、gpt、ai 等字眼，否则容易被墙探测到。\n\n### 使用 Vercel 一键部署\n\n1. Fork 本仓库\n2. 在 [Vercel](https://vercel.com/dashboard) 中 Add New Project\n3. 选择 chatgpt-next 点击 Import 进行导入\n\n### 使用 Zeabur 一键部署\n\n1. Fork 本仓库\n2. 在 [Zeabur](https://dash.zeabur.com) 中创建新服务\n3. 选择 chatgpt-next 导入部署\n\n### 使用 netlify 一键部署\n\n1. Fork 本仓库\n2. 在 [netlify](https://www.netlify.com/) 中 Add new site =\u003e Import an existing project\n3. 选择 chatgpt-next 点击 Deploy site 开始部署\n\n### 运行 docker 镜像\n\n```bash\ndocker run --name chatgpt-next -d -p 3000:3000 -e OPENAI_API_KEY_ALIAS xcatliu/chatgpt-next:latest\n# --name 容器名称，-d 后台运行，-p 端口映射，-e 透传环境变量\n```\n\n### 使用 npx 运行\n\n```bash\nnpx chatgpt-next -- -p 3000\n# -- 后面的参数会透传给 next start，比如 -p 可以指定端口，默认端口是 3000\n\n# 使用 pm2 后台运行\nnpx pm2 start --name chatgpt-next npx -- chatgpt-next -- -p 3000\n```\n\n## 配置\n\n以下表格记录了所有的环境变量配置，一些较为复杂的配置在后面有单独的说明。\n\n| 环境变量                      | 描述                               | 默认值           |\n| ----------------------------- | ---------------------------------- | ---------------- |\n| `OPENAI_API_KEY_ALIAS`        | apiKey 別名                        | 空               |\n| `CHATGPT_NEXT_DISABLE_PUBLIC` | 禁止陌生人通过他自己的 apiKey 访问 | `false`          |\n| `CHATGPT_NEXT_API_HOST`       | 配置 API 请求的 host（包含端口）   | `api.openai.com` |\n\n### OPENAI_API_KEY_ALIAS\n\n配置环境变量 `OPENAI_API_KEY_ALIAS` 即可支持 apiKey 别名。\n\n使用 `|` 分隔多项别名配置，每个别名配置使用 `:` 分隔别名和真实 apiKey，举例如下：\n\n```\nOPENAI_API_KEY_ALIAS=\"firstkey:sk-********FUt3|secondkey:sk-********f1J3\"\n```\n\n按照上面的配置，用户在打开页面的弹窗中输入 `firstkey` 就会以第一个 apiKey 发送请求，输入 `secondkey` 就会以第二个 apiKey 发送请求。\n\n链接中支持直接带上 `api-key`，更方便的分享给朋友，比如：\n\n```\nhttps://chatgpt-next.com/?api-key=firstkey\n```\n\n## 本地开发\n\n需要先安装 Node.js 环境，可以在[官网下载安装](https://nodejs.org/en/)。\n\n```bash\n# 安装依赖\nnpm i -g pnpm\npnpm i\n# 本地开发\npnpm dev\n\n# 构建\npnpm build\n# 启动\npnpm start\n```\n\n### 重要提醒\n\n**中国地区直接请求 OpenAI 接口可能导致封号，所以 dev 环境下跳过了请求。如需发送请求，请将 [app/api/chat/route.ts](https://github.com/xcatliu/chatgpt-next/blob/main/app/api/chat/route.ts) 文件中的相关代码注释掉。**\n\n### whistle 代理\n\n使用 [whistle](https://github.com/avwo/whistle) 可以方便的抓包，并将 api 请求代理到现网。\n\n下面是本地开发时的 whistle 配置：\n\n```\nchatgpt-next.com/api ignore://*\nchatgpt-next.com 127.0.0.1:3000\n```\n\n## 备份网址\n\n- https://chatgpt-next.com\n- https://1.caninae.com\n- https://chatgpt-next-xcatliu.vercel.app\n- https://chatgpt-next.zeabur.app\n- https://chatgpt-next-xcatliu.netlify.app\n\n如果你也部署了一个站点并且愿意公开出来，欢迎 pr！\n\n## 开源协议\n\nMIT，随便拿去用，记得帮我多宣传宣传。\n\n如果觉得帮助到你了，欢迎[请我喝一杯咖啡 ☕️](https://github.com/xcatliu/buy-me-a-coffee)。\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=xcatliu/chatgpt-next\u0026type=Date)](https://star-history.com/#xcatliu/chatgpt-next\u0026Date)\n\n---\n\nMIT License\n\nCopyright (c) 2023 xcatliu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcatliu%2Fchatgpt-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcatliu%2Fchatgpt-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcatliu%2Fchatgpt-next/lists"}