Disclaimer: This project is only published on GitHub,
based on the MIT license, free and for open source learning usage. And
there will be no any form of account selling, paid service, discussion
group, discussion group and other behaviors. Beware of being deceived.
Supports dual models and provides two unofficial ChatGPT API methods
Method
Free?
Reliability
Quality
ChatGPTAPI(gpt-3.5-turbo-0301)
No
Reliable
Relatively stupid
ChatGPTUnofficialProxyAPI(web accessToken)
Yes
Relatively unreliable
Smart
Comparison:
ChatGPTAPI uses gpt-3.5-turbo through OpenAI official API to call ChatGPT
ChatGPTUnofficialProxyAPI uses unofficial proxy server to access ChatGPT's backend API, bypass Cloudflare (dependent on third-party servers, and has rate limits)
Warnings:
You should first use the API method
When using the API, if the network is not working, it
is blocked in China, you need to build your own proxy, never use someone
else's public proxy, which is dangerous.
When using the accessToken method, the reverse proxy
will expose your access token to third parties. This should not have any
adverse effects, but please consider the risks before using this
method.
When using accessToken, whether you are a domestic or foreign machine, proxies will be used. The default proxy is pengzhile's https://ai.fakeopen.com/api/conversation. This is not a backdoor or monitoring unless you have the ability to flip over CF verification yourself. Use beforehand acknowledge. Community Proxy (Note: Only these two are recommended, other third-party sources, please identify for yourself)
When publishing the project to public network, you should set the AUTH_SECRET_KEY variable to add your password access, you should also modify the title in index. html to prevent it from being searched by keywords.
Switching methods:
Enter the service/.env.example file, copy the contents to the service/.env file
To use OpenAI API Key, fill in the OPENAI_API_KEY field (get apiKey)
To use Web API, fill in the OPENAI_ACCESS_TOKEN field (get accessToken)
[✓] Formatting and beautification of code and other message types
[✓] Access control
[✓] Data import/export
[✓] Save messages as local images
[✓] Multilingual interface
[✓] Interface themes
[✗] More...
Prerequisites
Node
node requires version ^16 || ^18 || ^19 (node >= 14 needs fetch polyfill installation), use nvm to manage multiple local node versions
node -v
PNPM
If you haven't installed pnpm
npm install pnpm -g
Filling in the Key
Get Openai Api Key or accessToken and fill in the local environment variables Go to Introduction
# service/.env file
# OpenAI API Key - https://platform.openai.com/overview
OPENAI_API_KEY=
# change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response
OPENAI_ACCESS_TOKEN=
Install Dependencies
For the convenience of "backend developers" to understand
the burden, the front-end "workspace" mode is not adopted, but separate
folders are used to store them. If you only need to do secondary
development of the front-end page, delete the service folder.
Backend
Enter the folder /service and run the following commands
pnpm install
Frontend
Run the following commands at the root directory
pnpm bootstrap
Run in Test Environment
Backend Service
Enter the folder /service and run the following commands
pnpm start
Frontend Webpage
Run the following commands at the root directory
pnpm dev
Environment Variables
API available:
OPENAI_API_KEY and OPENAI_ACCESS_TOKEN choose one
OPENAI_API_MODEL Set model, optional, default: gpt-3.5-turbo
OPENAI_API_BASE_URL Set interface address, optional, default: https://api.openai.com
OPENAI_API_DISABLE_DEBUG Set interface to close debug logs, optional, default: empty does not close
ACCESS_TOKEN available:
OPENAI_ACCESS_TOKEN and OPENAI_API_KEY choose one, OPENAI_API_KEY takes precedence when both exist
API_REVERSE_PROXY Set reverse proxy, optional, default: https://ai.fakeopen.com/api/conversation, Community (Note: Only these two are recommended, other third party sources, please identify for yourself)
Common:
AUTH_SECRET_KEY Access permission key, optional
MAX_REQUEST_PER_HOUR Maximum number of requests per hour, optional, unlimited by default
TIMEOUT_MS Timeout, unit milliseconds, optional
SOCKS_PROXY_HOST and SOCKS_PROXY_PORT take effect together, optional
SOCKS_PROXY_PORT and SOCKS_PROXY_HOST take effect together, optional
version: '3'services:
app:
image: chenzhaoyu94/chatgpt-web # always use latest, pull the tag image again to updateports:
- 127.0.0.1:3002:3002environment:
# choose oneOPENAI_API_KEY: sk-xxx# choose oneOPENAI_ACCESS_TOKEN: xxx# API interface address, optional, available when OPENAI_API_KEY is setOPENAI_API_BASE_URL: xxx# API model, optional, available when OPENAI_API_KEY is set, https://platform.openai.com/docs/models# gpt-4, gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4-turbo-preview, gpt-4-0125-preview, gpt-4-1106-preview, gpt-4-0314, gpt-4-0613, gpt-4-32k, gpt-4-32k-0314, gpt-4-32k-0613, gpt-3.5-turbo-16k, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-3.5-turbo-0613, text-davinci-003, text-davinci-002, code-davinci-002OPENAI_API_MODEL: xxx# reverse proxy, optionalAPI_REVERSE_PROXY: xxx# access permission key, optionalAUTH_SECRET_KEY: xxx# maximum number of requests per hour, optional, unlimited by defaultMAX_REQUEST_PER_HOUR: 0# timeout, unit milliseconds, optionalTIMEOUT_MS: 60000# Socks proxy, optional, take effect with SOCKS_PROXY_PORTSOCKS_PROXY_HOST: xxx# Socks proxy port, optional, take effect with SOCKS_PROXY_HOSTSOCKS_PROXY_PORT: xxx# HTTPS proxy, optional, support http,https,socks5HTTPS_PROXY: http://xxx:7890
OPENAI_API_BASE_URL Optional, available when OPENAI_API_KEY is set
OPENAI_API_MODEL Optional, available when OPENAI_API_KEY is set
Prevent Crawlers
nginx
Fill in the following configuration in the nginx configuration file to prevent crawlers. You can refer to the docker-compose/nginx/nginx.conf file to add anti-crawler methods
# Prevent crawlers
if ($http_user_agent ~* "360Spider|JikeSpider|Spider|spider|bot|Bot|2345Explorer|curl|wget|webZIP|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|NSPlayer|bingbot")
{
return 403;
}
Deploy with Railway
Railway Environment Variables
Environment variable name
Required
Remarks
PORT
Required
Default 3002
AUTH_SECRET_KEY
Optional
Access permission key
MAX_REQUEST_PER_HOUR
Optional
Maximum number of requests per hour, optional, unlimited by default
A: Because there is a commit message verification, please follow the Commit Guide
Q: Where to change the request interface if only the front-end page is used?
A: The VITE_GLOB_API_URL field in the .env file at the root directory.
Q: All files explode red when saving?
A: vscode please install the recommended plug-ins for the project, or manually install the Eslint plug-in.
Q: No typewriter effect on the front end?
A: One possible reason is that after Nginx reverse proxy,
buffer is turned on, then Nginx will try to buffer some data from the
backend before sending it to the browser. Please try adding proxy_buffering off; after the reverse proxy parameter, then reload Nginx. Other web server configurations are similar.
This project is based on code originally created by yichengchen.
I discovered that the original version was not compatible with macOS 26
(Sequoia), so I modified the code to make it work on macOS 26. The
source code was forked from bannedbook/ClashX. The git history was lost because I accidentally deleted the .git folder when recreating the project after encountering some issues.
🚀 Next-Gen Client: ClashFX — A modern macOS proxy client with advanced features
🚀 Need Advanced Features? Try ClashFX
ClashX focuses on a simple, lightweight, and compatible
macOS proxy experience. If you need more advanced capabilities, we
recommend migrating to ClashFX, our next-generation macOS client built around the mihomo core.
ClashFX includes advanced features such as:
Enhanced Mode (TUN) for system-wide TCP/UDP traffic capture
Support for newer proxy protocols and mihomo core capabilities
Rule-based routing with domain, IP-CIDR, GeoIP, and process matching
Fake-IP DNS mode and gVisor userspace network stack
Built-in dashboard and a more complete modern macOS experience
A rule-based proxy client for macOS based on Clash.
ClashX aims to provide a simple and lightweight proxy client with an intuitive interface.
⚠️ Notice
Official Website: Please visit the official website at clashx.tech.
ClashX / ClashX Pro is only a proxy tool and does not provide any
proxy servers. For server-related issues or renewals, please contact
your service provider.
✨ Features
HTTP/HTTPS and SOCKS protocol support
Surge-like configuration
GeoIP rule support
Support for Vmess/Shadowsocks/Socks5/Trojan protocols
Netfilter TCP redirect support
macOS 10.14+ compatibility
macOS 15+ (Sequoia) support with compatibility fixes