简体中文 · English
- V0.1.4, 20240120, Supports one-click deployment with Zeabur, very convenient, highly recommended!
- V0.1.3, 20240120, Supports local deployment, can be deployed on your own server
- V0.1.2, 20240115, Fixes streaming output issues in non-search scenarios for the cloudflare worker version
- V0.1.1, 20240114, Supports one-click deployment with Vercel, currently suitable for those who like tinkering
For more historical updates, please see Version History
- search2ai, supports search and networking for OpenAI, and the large model will decide whether to connect to the network based on your input, not every time. No plugins needed, no need to change the key, just replace the custom address in your commonly used OpenAI third-party client, also supports self-deployment, and will not affect other features of using OpenAI, like drawing, voice, etc.
![]() |
![]() |
![]() |
![]() |
Direct use: Replace the custom domain in the client with the following address
https://api.search2ai.online
As shown in the picture
![]() |
![]() |
Demo site experience address: Demo Site, follow the instructions to use your key, replace the custom domain
One-Click Deployment with Zeabur (Highly Recommended)
Click the button for one-click deployment, default duckduckgo search, can be switched on your own
To keep the project updated, it is recommended to fork this repository first, then deploy your branch through Zeabur
Local Deployment
- Clone the repository locally
git clone https://github.com/fatwang2/search2ai
- Copy .env.template as .env, configure environment variables
- SEARCH_SERVICE: Currently supports google, bing, serpapi, serper, duckduckgo (recommended), required
- APIBASE: If you are using an OpenAI third-party proxy, you can fill it in here, note that v1 is not needed, not required
- BING_KEY: Required if choosing bing search, please search for tutorials, application address https://search2ai.online/bing
- GOOGLE_CX: Required if choosing Google search, Search engine ID, please search for tutorials, application address https://search2ai.online/googlecx
- GOOGLE_KEY: Required if choosing Google search, API key, application address https://search2ai.online/googlekey
- SERPAPI_KEY: Required if choosing serpapi, free 100 times/month, registration address https://search2ai.online/serpapi
- SERPER_KEY: Required if choosing serper, free 2500 times for 6 months, note variable name is different from above, registration address https://search2ai.online/serper
- Enter the api directory, run the program, and display the log in real-time
cd api && nohup node index.js > output.log 2>&1 & tail -f output.log
- Port 3014, the complete address after concatenation is as follows, can be configured according to the client's requirements for the apibase address (if https is required, need to use nginx for reverse proxy, many tutorials online)
http://localhost:3014/v1/chat/completions
Deployment with cloudflare worker
-
Copy the code of search2ai, no modifications needed! Deploy in cloudflare's worker, after going online, the worker's address can be used as your interface call's custom domain address, note the concatenation, worker address only represents the part before v1 XXX/v1/chat/completions
- SEARCH_SERVICE: Currently supports google, bing, serpapi, serper, duckduckgo, required
- APIBASE: If you are using an OpenAI third-party proxy, you can fill it in here, note that v1 is not needed, not required
- BING_KEY: Required if choosing bing search, please search for tutorials, application address https://search2ai.online/bing
- GOOGLE_CX: Required if choosing Google search, Search engine ID, please search for tutorials, application address https://search2ai.online/googlecx
- GOOGLE_KEY: Required if choosing Google search, API key, application address https://search2ai.online/googlekey
- SERPAPI_KEY: Required if choosing serpapi, free 100 times/month, registration address https://search2ai.online/serpapi
- SERPER_KEY: Required if choosing serper, free 2500 times for 6 months, note variable name is different from above, registration address https://search2ai.online/serper
- Configure triggers - custom domain in the worker, direct access to the worker's address in China might have issues, need to replace with custom domain
Deployment with Vercel
Special note: Vercel project does not support streaming output and has a 10s response limit, actual user experience is poor, released mainly for experts to pull request
One-click deployment
To ensure updates, you can also first fork this project and then deploy it on Vercel yourself
- Support for Gemini
- Support for Azure OpenAI
- Fix streaming output issues in Vercel project
- Improve the speed of streaming output
- Support more vertical searches