This API is a chat bot for querying Bing Chat with a Node.js app. I am using the 'chatgpt-api' library from the 'transitive-bullshit' repository.
1) Create a new project with Node.js and you need the following libreries:
libreary | npm |
---|---|
dotenv | npm install dotenv |
express | npm install express |
BingChat | npm install bing-chat --save |
2) Create a settings.env file and insert your BingChat cookie.
How to retrieve the cookie:
-
Log in to BingChat in your web browser
-
Press F12 (developer tools)
-
Navigate to the "Application" tab
-
Look for the "Cookies" option and copy the "_U" key
3) Run on your terminal
node app.js
You see:
Put this URL in your browser:
http://localhost:3000/chat?phrase=XXXXX
XXXXX= query