{"id":25179574,"url":"https://github.com/21hook/chatgpt-web","last_synced_at":"2026-01-18T18:01:52.735Z","repository":{"id":144074139,"uuid":"609861998","full_name":"21hook/ChatGPT-Web","owner":"21hook","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T13:18:05.000Z","size":4505,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T15:38:44.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vue","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/21hook.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.en.md","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-05T13:18:02.000Z","updated_at":"2025-01-09T15:42:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"79df5a73-ef60-4a70-84f2-739533052ec3","html_url":"https://github.com/21hook/ChatGPT-Web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21hook%2FChatGPT-Web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21hook%2FChatGPT-Web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21hook%2FChatGPT-Web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/21hook%2FChatGPT-Web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/21hook","download_url":"https://codeload.github.com/21hook/ChatGPT-Web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247117762,"owners_count":20886439,"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":[],"created_at":"2025-02-09T15:37:05.050Z","updated_at":"2026-01-18T18:01:52.728Z","avatar_url":"https://github.com/21hook.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT Web\n\n\u003cdiv style=\"font-size: 1.5rem;\"\u003e\n  \u003ca href=\"./README.md\"\u003e中文\u003c/a\u003e |\n  \u003ca href=\"./README.en.md\"\u003eEnglish\u003c/a\u003e \n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003e Disclaimer: This project is only released on GitHub, under the MIT License, free and for open-source learning purposes. There will be no account selling, paid services, discussion groups, or forums. Beware of fraud.\n\n![cover](./docs/c1.png)\n![cover2](./docs/c2.png)\n\n- [ChatGPT Web](#chatgpt-web)\n\t- [Introduction](#introduction)\n\t- [Roadmap](#roadmap)\n\t- [Prerequisites](#prerequisites)\n\t\t- [Node](#node)\n\t\t- [PNPM](#pnpm)\n\t\t- [Fill in the Keys](#fill-in-the-keys)\n\t- [Install Dependencies](#install-dependencies)\n\t\t- [Backend](#backend)\n\t\t- [Frontend](#frontend)\n\t- [Run in Test Environment](#run-in-test-environment)\n\t\t- [Backend Service](#backend-service)\n\t\t- [Frontend Webpage](#frontend-webpage)\n\t- [Packaging](#packaging)\n\t\t- [Using Docker](#using-docker)\n\t\t\t- [Docker Parameter Example](#docker-parameter-example)\n\t\t\t- [Docker Build \u0026 Run](#docker-build--run)\n\t\t\t- [Docker Compose](#docker-compose)\n\t\t- [Deploying with Railway](#deploying-with-railway)\n\t\t\t- [Railway Environment Variables](#railway-environment-variables)\n\t\t- [Manual Packaging](#manual-packaging)\n\t\t\t- [Backend Service](#backend-service-1)\n\t\t\t- [Frontend Webpage](#frontend-webpage-1)\n\t- [FAQ](#faq)\n\t- [Contributing](#contributing)\n\t- [Sponsor](#sponsor)\n\t- [License](#license)\n\n## Introduction\n\nSupports dual models, provides two unofficial `ChatGPT API` methods:\n\n| Method                                        | Free?  | Reliability | Quality |\n| --------------------------------------------- | ------ | ----------- | ------- |\n| `ChatGPTAPI(gpt-3.5-turbo-0301)`                           | No     | Reliable    | Relatively clumsy |\n| `ChatGPTUnofficialProxyAPI(Web accessToken)` | Yes    | Relatively unreliable | Smart |\n\nComparison:\n1. `ChatGPTAPI` uses `gpt-3.5-turbo-0301` to simulate `ChatGPT` through the official `OpenAI` completion `API` (the most reliable method, but it is not free and does not use models specifically tuned for chat).\n2. `ChatGPTUnofficialProxyAPI` accesses `ChatGPT`'s backend `API` via an unofficial proxy server to bypass `Cloudflare` (uses the real `ChatGPT`, is very lightweight, but depends on third-party servers and has rate limits).\n\n[Details](https://github.com/Chanzhaoyu/chatgpt-web/issues/138)\n\nSwitching Methods:\n1. Go to the `service/.env` file.\n2. For `OpenAI API Key`, fill in the `OPENAI_API_KEY` field [(Get apiKey)](https://platform.openai.com/overview).\n3. For `Web API`, fill in the `OPENAI_ACCESS_TOKEN` field [(Get accessToken)](https://chat.openai.com/api/auth/session).\n4. When both are present, `OpenAI API Key` takes precedence.\n\nReverse Proxy:\n\nAvailable when using `ChatGPTUnofficialProxyAPI`.\n\n```shell\n# service/.env\nAPI_REVERSE_PROXY=\n```\n\nEnvironment Variables:\n\nFor all parameter variables, check [here](#docker-parameter-example) or see:\n\n```\n/service/.env\n```\n\n## Roadmap\n[✓] Dual models\n\n[✓] Multiple session storage and context logic\n\n[✓] Formatting and beautifying code-like message types\n\n[✓] Multilingual interface\n\n[✓] Interface themes\n\n[✗] More...\n\n## Prerequisites\n\n### Node\n\n`node` requires version `^16 || ^18` (`node \u003e= 14` requires installation of [fetch polyfill](https://github.com/developit/unfetch#usage-as-a-polyfill)), and multiple local `node` versions can be managed using [nvm](https://github.com/nvm-sh/nvm).\n\n```shell\nnode -v\n```\n\n### PNPM\nIf you have not installed `pnpm` before:\n```shell\nnpm install pnpm -g\n```\n\n### Fill in the Keys\n\nGet `Openai Api Key` or `accessToken` and fill in the local environment variables [jump](#introduction)\n\n```\n# service/.env file\n\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\n## Install Dependencies\n\n\u003e To make it easier for `backend developers` to understand, we did not use the front-end `workspace` mode, but stored it in different folders. If you only need to do secondary development of the front-end page, delete the `service` folder.\n\n### Backend\n\nEnter the `/service` folder and run the following command\n\n```shell\npnpm install\n```\n\n### Frontend\nRun the following command in the root directory\n```shell\npnpm bootstrap\n```\n\n## Run in Test Environment\n### Backend Service\n\nEnter the `/service` folder and run the following command\n\n```shell\npnpm start\n```\n\n### Frontend Webpage\nRun the following command in the root directory\n```shell\npnpm dev\n```\n\n## Packaging\n\n### Using Docker\n\n#### Docker Parameter Example\n\n- `OPENAI_API_KEY` one of two\n- `OPENAI_ACCESS_TOKEN` one of two, `OPENAI_API_KEY` takes precedence when both are present\n- `OPENAI_API_BASE_URL` optional, available when `OPENAI_API_KEY` is set\n- `API_REVERSE_PROXY` optional, available when `OPENAI_ACCESS_TOKEN` is set [Reference](#introduction)\n- `TIMEOUT_MS` timeout, in milliseconds, optional\n- `SOCKS_PROXY_HOST` optional, effective with SOCKS_PROXY_PORT\n- `SOCKS_PROXY_PORT` optional, effective with SOCKS_PROXY_HOST\n\n![docker](./docs/docker.png)\n\n#### Docker Build \u0026 Run\n\n```bash\ndocker build -t chatgpt-web .\n\n# foreground operation\ndocker run --name chatgpt-web --rm -it -p 3002:3002 --env OPENAI_API_KEY=your_api_key chatgpt-web\n\n# background operation\ndocker run --name chatgpt-web -d -p 3002:3002 --env OPENAI_API_KEY=your_api_key chatgpt-web\n\n# running address\nhttp://localhost:3002/\n```\n\n#### Docker Compose\n\n[Hub Address](https://hub.docker.com/repository/docker/chenzhaoyu94/chatgpt-web/general)\n\n```yml\nversion: '3'\n\nservices:\n  app:\n    image: chenzhaoyu94/chatgpt-web # always use latest, pull the tag image again when updating\n    ports:\n      - 3002:3002\n    environment:\n      # one of two\n      OPENAI_API_KEY: xxxxxx\n      # one of two\n      OPENAI_ACCESS_TOKEN: xxxxxx\n      # api interface url, optional, available when OPENAI_API_KEY is set\n      OPENAI_API_BASE_URL: xxxx\n      # reverse proxy, optional\n      API_REVERSE_PROXY: xxx\n      # timeout, in milliseconds, optional\n      TIMEOUT_MS: 60000\n      # socks proxy, optional, effective with SOCKS_PROXY_PORT\n      SOCKS_PROXY_HOST: xxxx\n      # socks proxy port, optional, effective with SOCKS_PROXY_HOST\n      SOCKS_PROXY_PORT: xxxx\n```\nThe `OPENAI_API_BASE_URL` is optional and only used when setting the `OPENAI_API_KEY`.\n\n### Deployment with Railway\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/yytmgc)\n\n#### Railway Environment Variables\n\n| Environment Variable | Required | Description                                                                                       |\n| -------------------- | -------- | ------------------------------------------------------------------------------------------------- |\n| `PORT`               | Required | Default: `3002`                                                                                   |\n| `TIMEOUT_MS`         | Optional | Timeout in milliseconds.                                                                          |\n| `OPENAI_API_KEY`     | Optional | Required for `OpenAI API`. `apiKey` can be obtained from [here](https://platform.openai.com/overview). |\n| `OPENAI_ACCESS_TOKEN`| Optional | Required for `Web API`. `accessToken` can be obtained from [here](https://chat.openai.com/api/auth/session).|\n| `OPENAI_API_BASE_URL`  | Optional, only for `OpenAI API` |  API endpoint.                                                        |\n| `API_REVERSE_PROXY`  | Optional, only for `Web API` | Reverse proxy address for `Web API`. [Details](https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy) |\n| `SOCKS_PROXY_HOST`   | Optional, effective with `SOCKS_PROXY_PORT` | Socks proxy.                      |\n| `SOCKS_PROXY_PORT`   | Optional, effective with `SOCKS_PROXY_HOST` | Socks proxy port.                 |\n\n\u003e Note: Changing environment variables in Railway will cause re-deployment.\n\n### Manual packaging\n\n#### Backend service\n\n\u003e If you don't need the `node` interface of this project, you can skip the following steps.\n\nCopy the `service` folder to a server that has a `node` service environment.\n\n```shell\n# Install\npnpm install\n\n# Build\npnpm build\n\n# Run\npnpm prod\n```\n\nPS: You can also run `pnpm start` directly on the server without packaging.\n\n#### Frontend webpage\n\n1. Modify `VITE_APP_API_BASE_URL` in `.env` at the root directory to your actual backend interface address.\n2. Run the following command in the root directory and then copy the files in the `dist` folder to the root directory of your website service.\n\n[Reference information](https://cn.vitejs.dev/guide/static-deploy.html#building-the-app)\n\n```shell\npnpm build\n```\n\n## Frequently Asked Questions\n\nQ: Why does Git always report an error when committing?\n\nA: Because there is submission information verification, please follow the [Commit Guidelines](./CONTRIBUTING.en.md).\n\nQ: Where to change the request interface if only the frontend page is used?\n\nA: The `VITE_GLOB_API_URL` field in the `.env` file at the root directory.\n\nQ: All red when saving the file?\n\nA: For `vscode`, please install the recommended plug-in of the project or manually install the `Eslint` plug-in.\n\nQ: Why doesn't the frontend have a typewriter effect?\n\nA: One possible reason is that after Nginx reverse proxying, buffering is turned on, and Nginx will try to buffer a certain amount of data from the backend before sending it to the browser. Please try adding `proxy_buffering off;` after the reverse proxy parameter and then reloading Nginx. Other web server configurations are similar.\n\n## Contributing\n\nPlease read the [Contributing Guidelines](./CONTRIBUTING.en.md) before contributing.\n\nThanks to all the contributors!\n\n\u003ca href=\"https://github.com/Chanzhaoyu/chatgpt-web/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Chanzhaoyu/chatgpt-web\" /\u003e\n\u003c/a\u003e\n\n## Sponsorship\n\nIf you find this project helpful and circumstances permit, you can give me a little support. Thank you very much for your support~\n\n\u003cdiv style=\"display: flex; gap: 20px;\"\u003e\n\t\u003cdiv style=\"text-align: center\"\u003e\n\t\t\u003cimg style=\"max-width: 100%\" src=\"./docs/wechat.png\" alt=\"WeChat\" /\u003e\n\t\t\u003cp\u003eWeChat Pay\u003c/p\u003e\n\t\u003c/div\u003e\n\t\u003cdiv style=\"text-align: center\"\u003e\n\t\t\u003cimg style=\"max-width: 100%\" src=\"./docs/alipay.png\" alt=\"Alipay\" /\u003e\n\t\t\u003cp\u003eAlipay\u003c/p\u003e\n\t\u003c/div\u003e\n\u003c/div\u003e\n\n## License\nMIT © [ChenZhaoYu](./license)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F21hook%2Fchatgpt-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F21hook%2Fchatgpt-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F21hook%2Fchatgpt-web/lists"}