Node.js module for ChatGPT/Bing AI, plus REST API server and CLI app
Top 11.9% on sourcepulse
This project provides a versatile Node.js client for interacting with OpenAI's ChatGPT and Bing AI models. It offers a Node.js module, a REST API server, and a CLI application, enabling developers and users to integrate advanced AI chat capabilities into various applications and workflows.
How It Works
The library offers three primary clients: ChatGPTClient
for the official OpenAI API (gpt-3.5-turbo
, text-davinci-003
), BingAIClient
for Bing's GPT-4 powered chat, and ChatGPTBrowserClient
for direct interaction with chat.openai.com
via a reverse proxy. ChatGPTClient
replicates conversation threads using message and conversation IDs, with optional persistent storage via Keyv. BingAIClient
includes a "jailbreak" mode for unlimited messages. The clients support customizable prompts, user labels, and AI labels for persona control.
Quick Start & Requirements
npm i @waylaidwanderer/chatgpt-api
or npm i -g @waylaidwanderer/chatgpt-api
for global CLI/server use.ChatGPTClient
. Bing AI requires a userToken
or cookies.Highlighted Details
gpt-3.5-turbo
via OpenAI API, priced per token.BingAIClient
with GPT-4 and a "jailbreak" mode.ChatGPTBrowserClient
uses a reverse proxy for Cloudflare bypass to access chat.openai.com
.keyv-file
).Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Automating chat.openai.com
carries a risk of account bans. The ChatGPTBrowserClient
exposes your access token to a third-party server. ChatGPTClient
conversations are limited to approximately the last 3000 tokens, potentially causing earlier messages to be forgotten.
1 year ago
1 day