+ +
+ +We still support both the official ChatGPT API and the unofficial proxy API, but we now recommend using the official API since it's significantly more robust and supports **GPT-4**. + +| Method | Free? | Robust? | Quality? | +| --------------------------- | ------ | ------- | ------------------------------- | +| `ChatGPTAPI` | β No | β Yes | β οΈ Real ChatGPT models + GPT-4 | +| `ChatGPTUnofficialProxyAPI` | β Yes | β NoοΈ | β ChatGPT webapp | + +**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI. We will likely remove support for `ChatGPTUnofficialProxyAPI` in a future release. + +1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo` model with the official OpenAI chat completions API (official, robust approach, but it's not free) +2. `ChatGPTUnofficialProxyAPI` - Uses an unofficial proxy server to access ChatGPT's backend API in a way that circumvents Cloudflare (uses the real ChatGPT and is pretty lightweight, but relies on a third-party server and is rate-limited) + ++ +
+ ## Install ```bash @@ -168,18 +207,18 @@ Make sure you're using `node >= 18` so `fetch` is available (or `node >= 14` if To use this module from Node.js, you need to pick between two methods: -| Method | Free? | Robust? | Quality? | -| --------------------------- | ------ | -------- | ----------------------- | -| `ChatGPTAPI` | β No | β Yes | β οΈ Real ChatGPT models | -| `ChatGPTUnofficialProxyAPI` | β Yes | βοΈ Maybe | β Real ChatGPT | +| Method | Free? | Robust? | Quality? | +| --------------------------- | ------ | ------- | ------------------------------- | +| `ChatGPTAPI` | β No | β Yes | β οΈ Real ChatGPT models + GPT-4 | +| `ChatGPTUnofficialProxyAPI` | β Yes | β NoοΈ | β Real ChatGPT webapp | -1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo-0301` model with the official OpenAI chat completions API (official, robust approach, but it's not free). You can override the model, completion params, and system message to fully customize your assistant. +1. `ChatGPTAPI` - Uses the `gpt-3.5-turbo` model with the official OpenAI chat completions API (official, robust approach, but it's not free). You can override the model, completion params, and system message to fully customize your assistant. 2. `ChatGPTUnofficialProxyAPI` - Uses an unofficial proxy server to access ChatGPT's backend API in a way that circumvents Cloudflare (uses the real ChatGPT and is pretty lightweight, but relies on a third-party server and is rate-limited) Both approaches have very similar APIs, so it should be simple to swap between them. -**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI. We may remove support for `ChatGPTUnofficialProxyAPI` in a future release. +**Note**: We strongly recommend using `ChatGPTAPI` since it uses the officially supported API from OpenAI and it also supports `gpt-4`. We will likely remove support for `ChatGPTUnofficialProxyAPI` in a future release. ### Usage - ChatGPTAPI @@ -198,12 +237,13 @@ async function example() { } ``` -You can override the default `model` (`gpt-3.5-turbo-0301`) and any [OpenAI chat completion params](https://platform.openai.com/docs/api-reference/chat/create) using `completionParams`: +You can override the default `model` (`gpt-3.5-turbo`) and any [OpenAI chat completion params](https://platform.openai.com/docs/api-reference/chat/create) using `completionParams`: ```ts const api = new ChatGPTAPI({ apiKey: process.env.OPENAI_API_KEY, completionParams: { + model: 'gpt-4', temperature: 0.5, top_p: 0.8 } @@ -334,10 +374,10 @@ const api = new ChatGPTUnofficialProxyAPI({ Known reverse proxies run by community members include: -| Reverse Proxy URL | Author | Rate Limits | Last Checked | -| ------------------------------------------------ | -------------------------------------------- | ----------------- | ------------ | -| `https://bypass.churchless.tech/api/conversation` | [@acheong08](https://github.com/acheong08) | 5 req / 10 seconds by IP | 3/24/2023 | -| `https://api.pawan.krd/backend-api/conversation` | [@PawanOsman](https://github.com/PawanOsman) | 50 req / 15 seconds (~3 r/s) | 3/23/2023 | +| Reverse Proxy URL | Author | Rate Limits | Last Checked | +| ------------------------------------------------- | -------------------------------------------- | ---------------------------- | ------------ | +| `https://bypass.churchless.tech/api/conversation` | [@acheong08](https://github.com/acheong08) | 5 req / 10 seconds by IP | 3/24/2023 | +| `https://api.pawan.krd/backend-api/conversation` | [@PawanOsman](https://github.com/PawanOsman) | 50 req / 15 seconds (~3 r/s) | 3/23/2023 | Note: info on how the reverse proxies work is not being published at this time in order to prevent OpenAI from disabling access. @@ -512,8 +552,8 @@ If you create a cool integration, feel free to open a PR and add it to the list. ## Credits - Huge thanks to [@waylaidwanderer](https://github.com/waylaidwanderer), [@abacaj](https://github.com/abacaj), [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors πͺ -- The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross) - [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) π₯ +- I run the [ChatGPT Hackers Discord](https://www.chatgpthackers.dev/) with over 8k developers βΒ come join us! ## License