diff --git a/demos/demo-reverse-proxy.ts b/demos/demo-reverse-proxy.ts index bac09ff2..325766b9 100644 --- a/demos/demo-reverse-proxy.ts +++ b/demos/demo-reverse-proxy.ts @@ -14,17 +14,22 @@ dotenv.config() * ``` */ async function main() { + // WARNING: this method will expose your access token to a third-party. Please be + // aware of the risks before using this method. const api = new ChatGPTAPI({ - // rate limit of 15 requests per 15 seconds - apiReverseProxyUrl: 'https://chatgpt.pawan.krd/api/completions', + // TODO: this is a placeholder URL; there are several available reverse proxies, + // but we're not including them here out of an abundance of caution. + // More info on proxy servers in Discord: https://discord.gg/v9gERj825w + apiReverseProxyUrl: 'https://your-secret-proxy-url.com/completions', + // change this to an `accessToken` extracted from the ChatGPT site's `https://chat.openai.com/api/auth/session` response apiKey: process.env.OPENAI_ACCESS_TOKEN, completionParams: { // override this depending on the ChatGPT model you want to use // NOTE: if you are on a paid plan, you can't use the free model and vice-versa // model: 'text-davinci-002-render' // free, default model - model: 'text-davinci-002-render-paid' // paid, default model - // model: 'text-davinci-002-render-sha' // paid, turbo model + model: 'text-davinci-002-render-sha' // paid, default model (turbo) + // model: 'text-davinci-002-render-paid' // paid, legacy model }, debug: false }) diff --git a/src/chatgpt-api.ts b/src/chatgpt-api.ts index cd26df9d..2e3c9158 100644 --- a/src/chatgpt-api.ts +++ b/src/chatgpt-api.ts @@ -8,12 +8,6 @@ import * as types from './types' import { fetch } from './fetch' import { fetchSSE } from './fetch-sse' -// NOTE: this is not a public model, but it was leaked by the ChatGPT webapp. -// const CHATGPT_MODEL = 'text-chat-davinci-002-20230126' -// const CHATGPT_MODEL = 'text-chat-davinci-002-20221122' -// const CHATGPT_MODEL = 'text-chat-davinci-002-sensitive-20230126' -// const CHATGPT_MODEL = 'text-chat-davinci-002-sh-alpha-aoruigiofdj83' - // Official model (costs money and is not fine-tuned for chat) const CHATGPT_MODEL = 'text-davinci-003'