[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-waylaidwanderer--node-chatgpt-api":3,"tool-waylaidwanderer--node-chatgpt-api":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",152630,2,"2026-04-12T23:33:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":32,"env_os":91,"env_gpu":92,"env_ram":92,"env_deps":93,"category_tags":102,"github_topics":103,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":154},7002,"waylaidwanderer\u002Fnode-chatgpt-api","node-chatgpt-api","A client implementation for ChatGPT and Bing AI. Available as a Node.js module, REST API server, and CLI app.","node-chatgpt-api 是一个功能强大的 Node.js 客户端库，旨在帮助开发者轻松集成 ChatGPT 和必应 AI（Bing AI）的能力。它解决了直接调用大模型 API 时面临的复杂性，提供了三种灵活的使用方式：作为代码模块嵌入项目、搭建独立的 REST API 服务器，或直接通过命令行工具进行交互。\n\n对于需要在应用中添加智能对话功能的开发人员而言，这是一个理想的选择。它不仅支持官方 OpenAI API 中性价比极高的 gpt-3.5-turbo 模型，还实验性地接入了必应 GPT-4 后端，让用户能以更低的成本体验顶尖的对话能力。其独特的技术亮点在于内置了反向代理支持，能够绕过部分浏览器自动化限制，直接通过访问令牌与 ChatGPT 后端通信，从而避免了繁琐的浏览器模拟操作。此外，项目更新频繁，紧跟官方模型迭代，确保用户能第一时间使用最新技术。无论是构建聊天机器人、开发辅助工具，还是进行 AI 应用原型验证，node-chatgpt-api 都能提供稳定且高效的底层支持。","\u003Cp align=\"center\">\n  \u003Cimg alt=\"CLI demo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwaylaidwanderer_node-chatgpt-api_readme_b96c1c53c8e4.gif\">\n\u003C\u002Fp>\n\n## Updates\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>2023-03-01\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Support for the official ChatGPT model has been added!** You can now use the `gpt-3.5-turbo` model with the official OpenAI API, using `ChatGPTClient`. This is the same model that ChatGPT uses, and it's the most powerful model available right now. Usage of this model is **not free**, however it is **10x cheaper** (priced at $0.002 per 1k tokens) than `text-davinci-003`.\n\nSee OpenAI's post, [Introducing ChatGPT and Whisper APIs](https:\u002F\u002Fopenai.com\u002Fblog\u002Fintroducing-chatgpt-and-whisper-apis) for more information.\n\n~~To use it, set `modelOptions.model` to `gpt-3.5-turbo`, and `ChatGPTClient` will handle the rest.~~\nThe default model used in `ChatGPTClient` is now `gpt-3.5-turbo`.\nYou can still set `userLabel`, `chatGptLabel` and `promptPrefix` (system instructions) as usual.\n\n**There may be a higher chance of your account being banned if you continue to automate chat.openai.com.** Continue doing so at your own risk.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Previous Updates\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n\u003Cbr\u002F>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-19\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nI've added an experimental `ChatGPTBrowserClient` which depends on a reverse proxy server that makes use of a Cloudflare bypass, allowing you to talk to ChatGPT (chat.openai.com) without requiring browser automation. All you need is your access token from https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession.\n\nAs always, please note that if you choose to go this route, you are exposing your access token to a closed-source third-party server. If you are concerned about this, you may choose to either use a free ChatGPT account to minimize risks, or continue using `ChatGPTClient` instead with the `text-davinci-003` model.\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-15\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nThe method we were using to access the ChatGPT underlying models has been patched, unfortunately. Your options right now are to either use the official OpenAI API with the `text-davinci-003` model (which costs money), or use a browser-based solution to interface with ChatGPT's backend (which is less powerful, more rate-limited and is not supported by this library at this time).\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-11\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nWith the help of @PawanOsman, **we've figured out a way to continue using the ChatGPT underlying models**. To hopefully prevent losing access again, we've decided to provide reverse proxy servers compatible with the OpenAI API. I've updated `ChatGPTClient` to support using a reverse proxy server instead of the OpenAI API server. See [Using a Reverse Proxy](#using-a-reverse-proxy) for more information on available proxy servers and how they work.\n\nPlease note that if you choose to go this route, you are exposing your access token to a closed-source third-party server. If you are concerned about this, you may choose to either use a free ChatGPT account to minimize risks, or continue using the official OpenAI API instead with the `text-davinci-003` model.\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-10\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n~~I've found a new working model for `text-chat-davinci-002`, `text-chat-davinci-002-sh-alpha-aoruigiofdj83`. This is the underlying model that the ChatGPT Plus \"Turbo\" version uses. Responses are blazing fast. I've updated the library to use this model.~~\n\nBad timing; `text-chat-davinci-002-sh-alpha-aoruigiofdj83` was removed shortly after, possibly due to a new model somewhere out there?\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-09\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nExperience the power of Bing's GPT-4 version of ChatGPT with [`BingAIClient`](src\u002FBingAIClient.js) (experimental).\n**The ~~API server and~~ CLI still need to be updated to support this**, but you can [use the client](#module) directly right now.\n*Please note that if your account is still wait-listed, you will not be able to use this client.*\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-08\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nEven though `text-chat-davinci-002-20221122` is back up again, it seems like it's constantly overloaded and returns a 429 error. It's likely that OpenAI only dedicated a small amount of resources to this model to prevent it being widely used by the public. Additionally, I've heard that newer versions are now access-locked to OpenAI employees and partners, so it's unlikely that we'll be able to find any workarounds until the model is officially released.\n\nYou may use the `text-davinci-003` model instead as a drop-in replacement. Keep in mind that `text-davinci-003` is not as good as `text-chat-davinci-002` (which is trained via RHLF and fine-tuned to be a conversational AI), though results are still pretty good in most cases. **Please note that using `text-davinci-003` will cost you credits ($).**\n\nI will be re-adding support for the browser-based ChatGPT for the API server and CLI. Please star and watch this repository for updates.\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-07\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nThe roller coaster has reached the next stop. `text-chat-davinci-002-20221122` is back up again.\n\n~~Trying to use `text-chat-davinci-002-20221122` with the OpenAI API now returns a 404 error.\nYou may use the `text-davinci-003` model instead as a drop-in replacement. Keep in mind that `text-davinci-003` is not as good as `text-chat-davinci-002` (which is trained via RHLF and fine-tuned to be a conversational AI), though results are still very good. **Please note that using `text-davinci-003` will cost you credits ($).**~~\n\n~~Please hold for further updates as we investigate further workarounds.~~\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-02\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n~~Trying to use `text-chat-davinci-002-20230126` with the OpenAI API now returns a 404 error. Someone has already found the new model name, but they are unwilling to share at this time. I will update this repository once I find the new model. If you have any leads, please open an issue or a pull request.~~\n\n~~In the meantime, I've added support for models like `text-davinci-003`, which you can use as a drop-in replacement. Keep in mind that `text-davinci-003` is not as good as `text-chat-davinci-002` (which is trained via RHLF and fine-tuned to be a conversational AI), though results are still very good. **Please note that using `text-davinci-003` will cost you credits ($).**~~\n\nDiscord user @pig#8932 has found a working `text-chat-davinci-002` model, `text-chat-davinci-002-20221122`. I've updated the library to use this model.\n\u003C\u002Fdetails>\n\u003C\u002Fdetails>\n\n# ChatGPT API\n\n> A client implementation for ChatGPT and Bing AI. Available as a Node.js module, REST API server, and CLI app.\n\n[![NPM](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@waylaidwanderer\u002Fchatgpt-api.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@waylaidwanderer\u002Fchatgpt-api)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdt\u002F@waylaidwanderer\u002Fchatgpt-api)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@waylaidwanderer\u002Fchatgpt-api)\n[![MIT License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue)](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fblob\u002Fmain\u002FLICENSE)\n[![GitHub Repo stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fwaylaidwanderer\u002Fnode-chatgpt-api)](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002F)\n\n# Table of Contents\n   * [Features](#features)\n   * [Getting Started](#getting-started)\n      * [Prerequisites](#prerequisites)\n      * [Usage](#usage)\n         * [Module](#module)\n         * [API Server](#api-server)\n         * [CLI](#cli)\n      * [Using a Reverse Proxy](#using-a-reverse-proxy)\n   * [Projects](#projects)\n   * [Web Client](#web-client)\n   * [Caveats](#caveats)\n   * [Contributing](#contributing)\n   * [License](#license)\n\n## Features\n- Includes an API server (with Docker support) you can run to use ChatGPT in non-Node.js applications.\n- Includes a CLI interface where you can chat with ChatGPT.\n- Includes clients that you can use in your own Node.js applications.\n- `ChatGPTClient`: support for the official ChatGPT underlying model, `gpt-3.5-turbo`, via OpenAI's API.\n  - Replicates chat threads from the official ChatGPT website (with conversation IDs and message IDs), with persistent conversations using [Keyv](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv).\n    - Conversations are stored in memory by default, but you can optionally [install a storage adapter](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv#usage) to persist conversations to a database.\n    - The `keyv-file` adapter is also included in this package, and can be used to store conversations in a JSON file if you're using the API server or CLI (see `settings.example.js`).\n  - Supports configurable prompt prefixes, and custom names for the user and ChatGPT.\n    - In essence, this allows you to make a chatbot with any personality you want.\n    - This is currently only configurable on a global level, but I plan to add support for per-conversation customization.\n  - Retains support for models like `text-davinci-003`\n- `BingAIClient`: support for Bing's version of ChatGPT, powered by GPT-4.\n  - Includes a built-in jailbreak you can activate which enables unlimited chat messages per conversation, unlimited messages per day, and brings Sydney back. 😊\n- `ChatGPTBrowserClient`: support for the official ChatGPT website, using a reverse proxy server for a Cloudflare bypass.\n  - **There may be a high chance of your account being banned if you continue to automate chat.openai.com.** Continue doing so at your own risk.\n\n## Getting Started\n\n### Prerequisites\n- Node.js >= 16.0.0\n- npm\n- Docker (optional, for API server)\n- [OpenAI API key](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys)\n\n## Usage\n\n### Module\n```bash\nnpm i @waylaidwanderer\u002Fchatgpt-api\n```\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>BingAIClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nSee [`demos\u002Fuse-bing-client.js`](demos\u002Fuse-bing-client.js).\n\u003C\u002Fdetails>\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>ChatGPTClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nSee [`demos\u002Fuse-client.js`](demos\u002Fuse-client.js).\n\u003C\u002Fdetails>\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>ChatGPTBrowserClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nSee [`demos\u002Fuse-browser-client.js`](demos\u002Fuse-browser-client.js).\n\u003C\u002Fdetails>\n\n### API Server\n\n\u003Ch4 id=\"api-server-setup\">Setup\u003C\u002Fh4>\n\nYou can install the package using\n```bash\nnpm i -g @waylaidwanderer\u002Fchatgpt-api\n```\nthen run it using\n`chatgpt-api`.\nThis takes an optional `--settings=\u003Cpath_to_settings.js>` parameter, or looks for `settings.js` in the current directory if not set, with the following contents:\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>settings.js\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```JS\nmodule.exports = {\n    \u002F\u002F Options for the Keyv cache, see https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv.\n    \u002F\u002F This is used for storing conversations, and supports additional drivers (conversations are stored in memory by default).\n    \u002F\u002F Only necessary when using `ChatGPTClient`, or `BingAIClient` in jailbreak mode.\n    cacheOptions: {},\n    \u002F\u002F If set, `ChatGPTClient` and `BingAIClient` will use `keyv-file` to store conversations to this JSON file instead of in memory.\n    \u002F\u002F However, `cacheOptions.store` will override this if set\n    storageFilePath: process.env.STORAGE_FILE_PATH || '.\u002Fcache.json',\n    chatGptClient: {\n        \u002F\u002F Your OpenAI API key (for `ChatGPTClient`)\n        openaiApiKey: process.env.OPENAI_API_KEY || '',\n        \u002F\u002F (Optional) Support for a reverse proxy for the completions endpoint (private API server).\n        \u002F\u002F Warning: This will expose your `openaiApiKey` to a third party. Consider the risks before using this.\n        \u002F\u002F reverseProxyUrl: 'https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions',\n        \u002F\u002F (Optional) Parameters as described in https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fcompletions\n        modelOptions: {\n            \u002F\u002F You can override the model name and any other parameters here.\n            \u002F\u002F The default model is `gpt-3.5-turbo`.\n            model: 'gpt-3.5-turbo',\n            \u002F\u002F Set max_tokens here to override the default max_tokens of 1000 for the completion.\n            \u002F\u002F max_tokens: 1000,\n        },\n        \u002F\u002F (Optional) Davinci models have a max context length of 4097 tokens, but you may need to change this for other models.\n        \u002F\u002F maxContextTokens: 4097,\n        \u002F\u002F (Optional) You might want to lower this to save money if using a paid model like `text-davinci-003`.\n        \u002F\u002F Earlier messages will be dropped until the prompt is within the limit.\n        \u002F\u002F maxPromptTokens: 3097,\n        \u002F\u002F (Optional) Set custom instructions instead of \"You are ChatGPT...\".\n        \u002F\u002F (Optional) Set a custom name for the user\n        \u002F\u002F userLabel: 'User',\n        \u002F\u002F (Optional) Set a custom name for ChatGPT (\"ChatGPT\" by default)\n        \u002F\u002F chatGptLabel: 'Bob',\n        \u002F\u002F promptPrefix: 'You are Bob, a cowboy in Western times...',\n        \u002F\u002F A proxy string like \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F (Optional) Set to true to enable `console.debug()` logging\n        debug: false,\n    },\n    \u002F\u002F Options for the Bing client\n    bingAiClient: {\n        \u002F\u002F Necessary for some people in different countries, e.g. China (https:\u002F\u002Fcn.bing.com)\n        host: '',\n        \u002F\u002F The \"_U\" cookie value from bing.com\n        userToken: '',\n        \u002F\u002F If the above doesn't work, provide all your cookies as a string instead\n        cookies: '',\n        \u002F\u002F A proxy string like \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F (Optional) Set to true to enable `console.debug()` logging\n        debug: false,\n    },\n    chatGptBrowserClient: {\n        \u002F\u002F (Optional) Support for a reverse proxy for the conversation endpoint (private API server).\n        \u002F\u002F Warning: This will expose your access token to a third party. Consider the risks before using this.\n        reverseProxyUrl: 'https:\u002F\u002Fbypass.churchless.tech\u002Fapi\u002Fconversation',\n        \u002F\u002F Access token from https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession\n        accessToken: '',\n        \u002F\u002F Cookies from chat.openai.com (likely not required if using reverse proxy server).\n        cookies: '',\n        \u002F\u002F A proxy string like \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F (Optional) Set to true to enable `console.debug()` logging\n        debug: false,\n    },\n    \u002F\u002F Options for the API server\n    apiOptions: {\n        port: process.env.API_PORT || 3000,\n        host: process.env.API_HOST || 'localhost',\n        \u002F\u002F (Optional) Set to true to enable `console.debug()` logging\n        debug: false,\n        \u002F\u002F (Optional) Possible options: \"chatgpt\", \"chatgpt-browser\", \"bing\". (Default: \"chatgpt\")\n        clientToUse: 'chatgpt',\n        \u002F\u002F (Optional) Generate titles for each conversation for clients that support it (only ChatGPTClient for now).\n        \u002F\u002F This will be returned as a `title` property in the first response of the conversation.\n        generateTitles: false,\n        \u002F\u002F (Optional) Set this to allow changing the client or client options in POST \u002Fconversation.\n        \u002F\u002F To disable, set to `null`.\n        perMessageClientOptionsWhitelist: {\n            \u002F\u002F The ability to switch clients using `clientOptions.clientToUse` will be disabled if `validClientsToUse` is not set.\n            \u002F\u002F To allow switching clients per message, you must set `validClientsToUse` to a non-empty array.\n            validClientsToUse: ['bing', 'chatgpt', 'chatgpt-browser'], \u002F\u002F values from possible `clientToUse` options above\n            \u002F\u002F The Object key, e.g. \"chatgpt\", is a value from `validClientsToUse`.\n            \u002F\u002F If not set, ALL options will be ALLOWED to be changed. For example, `bing` is not defined in `perMessageClientOptionsWhitelist` above,\n            \u002F\u002F so all options for `bingAiClient` will be allowed to be changed.\n            \u002F\u002F If set, ONLY the options listed here will be allowed to be changed.\n            \u002F\u002F In this example, each array element is a string representing a property in `chatGptClient` above.\n            chatgpt: [\n                'promptPrefix',\n                'userLabel',\n                'chatGptLabel',\n                \u002F\u002F Setting `modelOptions.temperature` here will allow changing ONLY the temperature.\n                \u002F\u002F Other options like `modelOptions.model` will not be allowed to be changed.\n                \u002F\u002F If you want to allow changing all `modelOptions`, define `modelOptions` here instead of `modelOptions.temperature`.\n                'modelOptions.temperature',\n            ],\n        },\n    },\n    \u002F\u002F Options for the CLI app\n    cliOptions: {\n        \u002F\u002F (Optional) Possible options: \"chatgpt\", \"bing\".\n        \u002F\u002F clientToUse: 'bing',\n    },\n};\n```\n\u003C\u002Fdetails>\n\nAlternatively, you can install and run the package directly.\n\n1. Clone this repository: `git clone https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api`\n2. Install dependencies with `npm install` (if not using Docker)\n3. Rename `settings.example.js` to `settings.js` in the root directory and change the settings where required.\n4. Start the server:\n    - using `npm start` or `npm run server` (if not using Docker)\n    - using `docker-compose up` (requires Docker)\n\n#### Endpoints\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>POST \u002Fconversation\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nStart or continue a conversation.\nOptional parameters are only necessary for conversations that span multiple requests.\n\n| Field                     | Description                                                                                                                                                                                                                                                     |\n|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| message                   | The message to be displayed to the user.                                                                                                                                                                                                                        |\n| conversationId            | (Optional) An ID for the conversation you want to continue.                                                                                                                                                                                                     |\n| jailbreakConversationId   | (Optional, for `BingAIClient` only) Set to `true` to start a conversation in jailbreak mode. After that, this should be the ID for the jailbreak conversation (given in the response as a parameter also named `jailbreakConversationId`).                      |\n| parentMessageId           | (Optional, for `ChatGPTClient`, and `BingAIClient` in jailbreak mode) The ID of the parent message (i.e. `response.messageId`) when continuing a conversation.                                                                                                  |\n| conversationSignature     | (Optional, for `BingAIClient` only) A signature for the conversation (given in the response as a parameter also named `conversationSignature`). Required when continuing a conversation unless in jailbreak mode.                                               |\n| clientId                  | (Optional, for `BingAIClient` only) The ID of the client. Required when continuing a conversation unless in jailbreak mode.                                                                                                                                     |\n| invocationId              | (Optional, for `BingAIClient` only) The ID of the invocation. Required when continuing a conversation unless in jailbreak mode.                                                                                                                                 |\n| clientOptions             | (Optional) An object containing options for the client.                                                                                                                                                                                                         |\n| clientOptions.clientToUse | (Optional) The client to use for this message. Possible values: `chatgpt`, `chatgpt-browser`, `bing`.                                                                                                                                                           |\n| clientOptions.*           | (Optional) Any valid options for the client. For example, for `ChatGPTClient`, you can set `clientOptions.openaiApiKey` to set an API key for this message only, or `clientOptions.promptPrefix` to give the AI custom instructions for this message only, etc. |\n\nTo configure which options can be changed per message (default: all), see the comments for `perMessageClientOptionsWhitelist` in `settings.example.js`.\nTo allow changing clients, `perMessageClientOptionsWhitelist.validClientsToUse` must be set to a non-empty array as described in the example settings file.\n\u003C\u002Fdetails>\n\n#### Usage\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Method 1 (POST)\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nTo start a conversation with ChatGPT, send a POST request to the server's `\u002Fconversation` endpoint with a JSON body with parameters per **Endpoints** > **POST \u002Fconversation** above.\n```JSON\n{\n    \"message\": \"Hello, how are you today?\",\n    \"conversationId\": \"your-conversation-id (optional)\",\n    \"parentMessageId\": \"your-parent-message-id (optional, for `ChatGPTClient` only)\",\n    \"conversationSignature\": \"your-conversation-signature (optional, for `BingAIClient` only)\",\n    \"clientId\": \"your-client-id (optional, for `BingAIClient` only)\",\n    \"invocationId\": \"your-invocation-id (optional, for `BingAIClient` only)\",\n}\n```\nThe server will return a JSON object containing ChatGPT's response:\n```JS\n\u002F\u002F HTTP\u002F1.1 200 OK\n{\n    \"response\": \"I'm doing well, thank you! How are you?\",\n    \"conversationId\": \"your-conversation-id\",\n    \"messageId\": \"response-message-id (for `ChatGPTClient` only)\",\n    \"conversationSignature\": \"your-conversation-signature (for `BingAIClient` only)\",\n    \"clientId\": \"your-client-id (for `BingAIClient` only)\",\n    \"invocationId\": \"your-invocation-id (for `BingAIClient` only - pass this new value back into subsequent requests as-is)\",\n    \"details\": \"an object containing the raw response from the client\"\n}\n```\n\nIf the request is unsuccessful, the server will return a JSON object with an error message.\n\nIf the request object is missing a required property (e.g. `message`):\n```JS\n\u002F\u002F HTTP\u002F1.1 400 Bad Request\n{\n    \"error\": \"The message parameter is required.\"\n}\n```\nIf there was an error sending the message to ChatGPT:\n```JS\n\u002F\u002F HTTP\u002F1.1 503 Service Unavailable\n{\n    \"error\": \"There was an error communicating with ChatGPT.\"\n}\n```\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Method 2 (SSE)\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nYou can set `\"stream\": true` in the request body to receive a stream of tokens as they are generated.\n\n```js\nimport { fetchEventSource } from '@waylaidwanderer\u002Ffetch-event-source'; \u002F\u002F use `@microsoft\u002Ffetch-event-source` instead if in a browser environment\n\nconst opts = {\n    method: 'POST',\n    headers: {\n        'Content-Type': 'application\u002Fjson',\n    },\n    body: JSON.stringify({\n        \"message\": \"Write a poem about cats.\",\n        \"conversationId\": \"your-conversation-id (optional)\",\n        \"parentMessageId\": \"your-parent-message-id (optional)\",\n        \"stream\": true,\n        \u002F\u002F Any other parameters per `Endpoints > POST \u002Fconversation` above\n    }),\n};\n```\n\nSee [demos\u002Fuse-api-server-streaming.js](demos\u002Fuse-api-server-streaming.js) for an example of how to receive the response as it's generated. You will receive one token at a time, so you will need to concatenate them yourself.\n\nSuccessful output:\n```JS\n{ data: '', event: '', id: '', retry: 3000 }\n{ data: 'Hello', event: '', id: '', retry: undefined }\n{ data: '!', event: '', id: '', retry: undefined }\n{ data: ' How', event: '', id: '', retry: undefined }\n{ data: ' can', event: '', id: '', retry: undefined }\n{ data: ' I', event: '', id: '', retry: undefined }\n{ data: ' help', event: '', id: '', retry: undefined }\n{ data: ' you', event: '', id: '', retry: undefined }\n{ data: ' today', event: '', id: '', retry: undefined }\n{ data: '?', event: '', id: '', retry: undefined }\n{ data: '\u003Cresult JSON here, see Method 1>', event: 'result', id: '', retry: undefined }\n{ data: '[DONE]', event: '', id: '', retry: undefined }\n\u002F\u002F Hello! How can I help you today?\n```\n\nError output:\n```JS\nconst message = {\n  data: '{\"code\":503,\"error\":\"There was an error communicating with ChatGPT.\"}',\n  event: 'error',\n  id: '',\n  retry: undefined\n};\n\nif (message.event === 'error') {\n  console.error(JSON.parse(message.data).error); \u002F\u002F There was an error communicating with ChatGPT.\n}\n```\n\u003C\u002Fdetails>\n\n#### Notes\n- Method 1 is simple, but Time to First Byte (TTFB) is long.\n- Method 2 uses a non-standard implementation of [server-sent event API](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events\u002FUsing_server-sent_events); you should import `fetch-event-source` first and use `POST` method.\n\n### CLI\n\n#### Setup\nFollow the same [setup instructions](#api-server-setup) for the API server, creating `settings.js`.\n\n#### Usage\nIf installed globally:\n```bash\nchatgpt-cli\n```\n\nIf installed locally:\n```bash\nnpm run cli\n```\n\nChatGPT's responses are automatically copied to your clipboard, so you can paste them into other applications.\n\n## Using a Reverse Proxy\nAs shown in the examples above, you can set `reverseProxyUrl` in `ChatGPTClient`'s options to use a reverse proxy server instead of the official ChatGPT API.\n~~For now, **this is the only way to use the ChatGPT underlying models**.~~ This method has been patched and the instructions below are no longer relevant, but you may still want to use a reverse proxy for other reasons.\nCurrently, reverse proxy servers are still used for performing a Cloudflare bypass for `ChatGPTBrowserClient`.\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Instructions\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nHow does it work? Simple answer: `ChatGPTClient` > reverse proxy > OpenAI server. The reverse proxy server does some magic under the hood to access the underlying model directly via OpenAI's server and then returns the response to `ChatGPTClient`.\n\nInstructions are provided below.\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions\u003C\u002Fstrong> (mine, \u003Cstrong>currently offline\u003C\u002Fstrong>)\u003C\u002Fsummary>\n\n#### Instructions\n1. Get your ChatGPT access token from https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession (look for the `accessToken` property).\n    * **This is NOT the same thing as the _session token_.**\n    * Automatically fetching or refreshing your ChatGPT access token is not currently supported by this library. Please handle this yourself for now.\n2. Set `reverseProxyUrl` to `https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions` in `settings.js > chatGptClient` or `ChatGPTClient`'s options.\n3. Set the \"OpenAI API key\" parameter (e.g. `settings.chatGptClient.openaiApiKey`) to the ChatGPT access token you got in step 1.\n4. Set the `model` to `text-davinci-002-render`, `text-davinci-002-render-paid`, or `text-davinci-002-render-sha` depending on which ChatGPT models that your account has access to. Models **must** be a ChatGPT model name, not the underlying model name, and you cannot use a model that your account does not have access to.\n    * You can check which ones you have access to by opening DevTools and going to the Network tab. Refresh the page and look at the response body for https:\u002F\u002Fchat.openai.com\u002Fbackend-api\u002Fmodels.\n\n#### Notes\n- Since this is my server, I can guarantee that no logging or tracking is done. I can see general usage stats, but I cannot see any of your completions. Whether you trust me on this or not is up to you.\n- Non-streaming responses over 60s are not supported. Use `stream: true` (API) or `onProgress` (client) as a workaround.\n- Rate limit of 10 requests per second.\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>https:\u002F\u002Fchatgpt.pawan.krd\u002Fapi\u002Fcompletions\u003C\u002Fstrong> (@PawanOsmon, \u003Cstrong>currently offline\u003C\u002Fstrong>)\u003C\u002Fsummary>\n\n#### Instructions\n1. Get your ChatGPT access token from https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession (look for the `accessToken` property).\n    * **This is NOT the same thing as the _session token_.**\n    * Automatically fetching or refreshing your ChatGPT access token is not currently supported by this library. Please handle this yourself for now.\n2. Set `reverseProxyUrl` to `https:\u002F\u002Fchatgpt.pawan.krd\u002Fapi\u002Fcompletions` in `settings.js > chatGptClient` or `ChatGPTClient`'s options.\n3. Set the \"OpenAI API key\" parameter (e.g. `settings.chatGptClient.openaiApiKey`) to the ChatGPT access token you got in step 1.\n4. Set the `model` to `text-davinci-002-render`, `text-davinci-002-render-paid`, or `text-davinci-002-render-sha` depending on which ChatGPT models that your account has access to. Models **must** be a ChatGPT model name, not the underlying model name, and you cannot use a model that your account does not have access to.\n    * You can check which ones you have access to by opening DevTools and going to the Network tab. Refresh the page and look at the response body for https:\u002F\u002Fchat.openai.com\u002Fbackend-api\u002Fmodels.\n\n#### Notes\n- Non-streaming responses over 60s are not supported. Use `stream: true` (API) or `onProgress` (client) as a workaround.\n- Rate limit of 50 requests per 15 seconds.\n\u003C\u002Fdetails>\n\u003C\u002Fdetails>\n\n## Projects\n🚀 A list of awesome projects using `@waylaidwanderer\u002Fchatgpt-api`:\n- [PandoraAI](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002FPandoraAI): my web chat client powered by node-chatgpt-api, allowing users to easily chat with multiple AI systems while also offering support for custom presets. With its seamless and convenient design, PandoraAI provides an engaging conversational AI experience.\n- [LibreChat](https:\u002F\u002Fgithub.com\u002Fdanny-avila\u002Fchatgpt-clone): integrates ChatGPT technology, enabling multiple AI models, conversation features, message search, and plugins. It offers free\u002Fpay-per-call APIs, eliminating ChatGPT Plus need, and supports customization.\n- [ChatGPT WebApp](https:\u002F\u002Fgithub.com\u002Ffrontend-engineering\u002Fchatgpt-webapp-fullstack): a fullstack chat webapp with mobile compatble UI interface, and node-chatgpt-api works as backend. Anyone can deploy your own chat service.\n- [halbot](https:\u002F\u002Fgithub.com\u002FLeask\u002Fhalbot): Just another ChatGPT\u002FBing Chat Telegram bot, which is simple design, easy to use, extendable and fun.\n- [ChatGPTBox](https:\u002F\u002Fgithub.com\u002FjosStorer\u002FchatGPTBox): Integrating ChatGPT into your browser deeply, everything you need is here\n- [llm-bot](https:\u002F\u002Fgithub.com\u002FErisfiregamer1\u002Fllm-bot): A Discord bot for LLM nonsense. Comes with a custom reverse proxy for GPT-4 allowing it to be accessed for free (Thank you \"generic\")!\n- [WhatsAppSydney](https:\u002F\u002Fgithub.com\u002Fveigamann\u002Fsydney-whatsapp-chatbot): Bing-powered personal assistant for WhatsApp. Simplify your day-to-day with ease.\n\nAdd yours to the list by [editing this README](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fedit\u002Fmain\u002FREADME.md) and creating a pull request!\n\n## Web Client\nA web client for this project is also available at [waylaidwanderer\u002FPandoraAI](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002FPandoraAI).\n\n## Caveats\n### Regarding `ChatGPTClient`\nSince `gpt-3.5-turbo` is ChatGPT's underlying model, I had to do my best to replicate the way the official ChatGPT website uses it.\nThis means my implementation or the underlying model may not behave exactly the same in some ways:\n- Conversations are not tied to any user IDs, so if that's important to you, you should implement your own user ID system.\n- ChatGPT's model parameters (temperature, frequency penalty, etc.) are unknown, so I set some defaults that I thought would be reasonable.\n- Conversations are limited to roughly the last 3000 tokens, so earlier messages may be forgotten during longer conversations.\n    - This works in a similar way to ChatGPT, except I'm pretty sure they have some additional way of retrieving context from earlier messages when needed (which can probably be achieved with embeddings, but I consider that out-of-scope for now).\n\n## Contributing\nIf you'd like to contribute to this project, please create a pull request with a detailed description of your changes.\n\n## License\nThis project is licensed under the MIT License.\n","\u003Cp align=\"center\">\n  \u003Cimg alt=\"CLI demo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwaylaidwanderer_node-chatgpt-api_readme_b96c1c53c8e4.gif\">\n\u003C\u002Fp>\n\n## 更新日志\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>2023-03-01\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**现已支持官方的 ChatGPT 模型！** 您现在可以使用 `ChatGPTClient` 和官方 OpenAI API 来调用 `gpt-3.5-turbo` 模型。该模型正是 ChatGPT 所使用的版本，也是目前功能最为强大的模型。不过，使用此模型**并非免费**，但其价格仅为 `text-davinci-003` 的 **十分之一**（每 1,000 个 token 收费 $0.002）。\n\n更多信息请参阅 OpenAI 的文章：[Introducing ChatGPT and Whisper APIs](https:\u002F\u002Fopenai.com\u002Fblog\u002Fintroducing-chatgpt-and-whisper-apis)。\n\n~~要使用它，只需将 `modelOptions.model` 设置为 `gpt-3.5-turbo`，剩下的工作将由 `ChatGPTClient` 自动完成。~~\n`ChatGPTClient` 中默认使用的模型现已更新为 `gpt-3.5-turbo`。\n您仍然可以像往常一样设置 `userLabel`、`chatGptLabel` 和 `promptPrefix`（系统指令）。\n\n**如果您继续自动化操作 chat.openai.com，您的账号被封禁的风险可能会更高。** 请自行承担风险继续使用。\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>以往更新\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n\u003Cbr\u002F>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-19\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n我新增了一个实验性的 `ChatGPTBrowserClient`，它依赖于一个利用 Cloudflare 绕过技术的反向代理服务器，使您无需浏览器自动化即可与 ChatGPT（chat.openai.com）进行对话。您只需要从 https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession 获取您的访问令牌即可。\n\n一如既往，请注意，如果您选择这种方式，您的访问令牌将会暴露给一个闭源的第三方服务器。如果您对此感到担忧，可以选择使用免费的 ChatGPT 账号以降低风险，或者继续使用 `ChatGPTClient` 并搭配 `text-davinci-003` 模型。\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-15\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n遗憾的是，我们之前用来访问 ChatGPT 底层模型的方法已经被修复了。目前您的选择是：要么使用官方 OpenAI API 并搭配 `text-davinci-003` 模型（需要付费），要么采用基于浏览器的解决方案来对接 ChatGPT 的后端服务（这种方式性能较弱、速率限制较多，且本库目前尚不支持）。\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-11\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n在 @PawanOsman 的帮助下，**我们找到了一种继续使用 ChatGPT 底层模型的方法**。为了尽量避免再次失去访问权限，我们决定提供与 OpenAI API 兼容的反向代理服务器。我已经更新了 `ChatGPTClient`，使其支持使用反向代理服务器而非 OpenAI API 服务器。有关可用代理服务器及其工作原理的更多信息，请参阅 [使用反向代理](#using-a-reverse-proxy)。\n\n请注意，如果您选择这种方式，您的访问令牌将会暴露给一个闭源的第三方服务器。如果您对此有所顾虑，可以选择使用免费的 ChatGPT 账号以降低风险，或者继续使用官方 OpenAI API 并搭配 `text-davinci-003` 模型。\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-10\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n~~我发现了一个新的可用模型 `text-chat-davinci-002`, 名称为 `text-chat-davinci-002-sh-alpha-aoruigiofdj83`。这正是 ChatGPT Plus “Turbo” 版本所使用的底层模型。响应速度极快。我已经更新了库以使用该模型。~~\n\n可惜好景不长，`text-chat-davinci-002-sh-alpha-aoruigiofdj83` 很快就被移除了，可能是因为 OpenAI 已经推出了新的模型吧？\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-09\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n借助 [`BingAIClient`](src\u002FBingAIClient.js)，体验必应版 GPT-4 的 ChatGPT 功能（实验性）。\n**API 服务器和 CLI 仍需更新以支持此功能**，但您现在就可以直接[使用该客户端](#module)。\n*请注意，如果您的账号仍在等待名单中，将无法使用此客户端。*\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-08\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n尽管 `text-chat-davinci-002-20221122` 又恢复了运行，但它似乎总是处于过载状态，频繁返回 429 错误。很可能是 OpenAI 只为该模型分配了少量资源，以防止其被大众广泛使用。此外，我还听说更新的版本现在已被锁定，仅供 OpenAI 员工和合作伙伴使用，因此在该模型正式发布之前，我们很难找到绕过限制的方法。\n\n您可以改用 `text-davinci-003` 模型作为替代方案。需要注意的是，`text-davinci-003` 的表现不如通过 RHLF 训练并专门优化为对话式 AI 的 `text-chat-davinci-002`，不过在大多数情况下，其效果仍然相当不错。**请注意，使用 `text-davinci-003` 需要消耗积分（付费）。**\n\n我将重新为基于浏览器的 ChatGPT 提供 API 服务器和 CLI 的支持。请为本仓库点赞并关注后续更新。\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-07\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n过山车来到了下一站。`text-chat-davinci-002-20221122` 再次上线了。\n\n~~现在尝试使用 `text-chat-davinci-002-20221122` 与 OpenAI API 对接会返回 404 错误。\n您可以改用 `text-davinci-003` 模型作为替代品。需要注意的是，`text-davinci-003` 的表现不如通过 RHLF 训练并优化为对话式 AI 的 `text-chat-davinci-002`，不过其效果依然非常出色。**请注意，使用 `text-davinci-003` 需要消耗积分（付费）。~~\n\n~~请耐心等待进一步更新，我们将继续探索其他绕过方法。~~\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>2023-02-02\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n~~现在尝试使用 `text-chat-davinci-002-20230126` 与 OpenAI API 对接会返回 404 错误。已经有人发现了新模型的名字，但他们目前不愿公开。一旦我找到新模型，就会更新本仓库。如果您有任何线索，请提交 issue 或 pull request。~~\n\n~~在此期间，我增加了对 `text-davinci-003` 等模型的支持，您可以将其作为替代品使用。需要注意的是，`text-davinci-003` 的表现不如通过 RHLF 训练并优化为对话式 AI 的 `text-chat-davinci-002`，不过其效果仍然非常不错。**请注意，使用 `text-davinci-003` 需要消耗积分（付费）。~~\n\nDiscord 用户 @pig#8932 发现了一个可用的 `text-chat-davinci-002` 模型，名为 `text-chat-davinci-002-20221122`。我已经更新了库以使用该模型。\n\u003C\u002Fdetails>\n\u003C\u002Fdetails>\n\n# ChatGPT API\n\n> 一个用于 ChatGPT 和 Bing AI 的客户端实现。提供 Node.js 模块、REST API 服务器和命令行工具三种形式。\n\n[![NPM](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@waylaidwanderer\u002Fchatgpt-api.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@waylaidwanderer\u002Fchatgpt-api)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdt\u002F@waylaidwanderer\u002Fchatgpt-api)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@waylaidwanderer\u002Fchatgpt-api)\n[![MIT License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue)](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fblob\u002Fmain\u002FLICENSE)\n[![GitHub 仓库星标数](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fwaylaidwanderer\u002Fnode-chatgpt-api)](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002F)\n\n# 目录\n   * [功能特性](#features)\n   * [快速上手](#getting-started)\n      * [先决条件](#prerequisites)\n      * [使用方法](#usage)\n         * [模块](#module)\n         * [API 服务器](#api-server)\n         * [命令行工具](#cli)\n      * [使用反向代理](#using-a-reverse-proxy)\n   * [项目](#projects)\n   * [Web 客户端](#web-client)\n   * [注意事项](#caveats)\n   * [贡献](#contributing)\n   * [许可证](#license)\n\n## 功能特性\n- 包含一个 API 服务器（支持 Docker），您可以在非 Node.js 应用中运行它来使用 ChatGPT。\n- 提供一个命令行界面，您可以直接与 ChatGPT 对话。\n- 提供可在您自己的 Node.js 应用中使用的客户端。\n- `ChatGPTClient`：通过 OpenAI 的 API 支持官方 ChatGPT 的底层模型 `gpt-3.5-turbo`。\n  - 可复现官方 ChatGPT 网站上的聊天线程（包括对话 ID 和消息 ID），并利用 [Keyv](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv) 实现持久化会话。\n    - 默认情况下，会话存储在内存中，但您也可以选择安装 [存储适配器](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv#usage) 将会话持久化到数据库。\n    - 此包还包含 `keyv-file` 适配器，可用于将会话存储为 JSON 文件，尤其适用于 API 服务器或命令行工具（参见 `settings.example.js`）。\n  - 支持可配置的提示前缀，以及自定义用户和 ChatGPT 的名称。\n    - 这使得您可以创建具有任意个性特征的聊天机器人。\n    - 目前此功能仅支持全局配置，但我计划未来增加按会话定制的功能。\n  - 同时保留对 `text-davinci-003` 等模型的支持。\n- `BingAIClient`：支持由 GPT-4 驱动的 Bing 版 ChatGPT。\n  - 内置了一个“越狱”模式，开启后可实现每轮对话无限消息、每日无限消息，并让 Sydney 回归。😊\n- `ChatGPTBrowserClient`：支持官方 ChatGPT 网站，通过反向代理服务器绕过 Cloudflare 限制。\n  - **如果您继续自动化操作 chat.openai.com，您的账户很可能被封禁。** 请自行承担风险。\n\n## 快速上手\n\n### 先决条件\n- Node.js >= 16.0.0\n- npm\n- Docker（可选，用于 API 服务器）\n- [OpenAI API 密钥](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys)\n\n## 使用方法\n\n### 模块\n```bash\nnpm i @waylaidwanderer\u002Fchatgpt-api\n```\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>BingAIClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n参见 [`demos\u002Fuse-bing-client.js`](demos\u002Fuse-bing-client.js)。\n\u003C\u002Fdetails>\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>ChatGPTClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n参见 [`demos\u002Fuse-client.js`](demos\u002Fuse-client.js)。\n\u003C\u002Fdetails>\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>ChatGPTBrowserClient\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n参见 [`demos\u002Fuse-browser-client.js`](demos\u002Fuse-browser-client.js)。\n\u003C\u002Fdetails>\n\n### API 服务器\n\n\u003Ch4 id=\"api-server-setup\">设置\u003C\u002Fh4>\n\n您可以使用以下命令安装该包：\n```bash\nnpm i -g @waylaidwanderer\u002Fchatgpt-api\n```\n然后通过运行 `chatgpt-api` 来启动服务。该命令接受一个可选参数 `--settings=\u003Cpath_to_settings.js>`，若未指定，则会在当前目录下查找名为 `settings.js` 的配置文件，其内容如下：\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>settings.js\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```JS\nmodule.exports = {\n    \u002F\u002F Keyv 缓存的选项，详见 https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fkeyv。\n    \u002F\u002F 用于存储对话，默认存储在内存中，但支持其他驱动程序。\n    \u002F\u002F 仅在使用 `ChatGPTClient` 或 jailbreak 模式下的 `BingAIClient` 时需要。\n    cacheOptions: {},\n    \u002F\u002F 如果设置，`ChatGPTClient` 和 `BingAIClient` 将使用 `keyv-file` 将对话存储到此 JSON 文件中，而不是存储在内存中。\n    \u002F\u002F 但如果设置了 `cacheOptions.store`，则会覆盖此设置。\n    storageFilePath: process.env.STORAGE_FILE_PATH || '.\u002Fcache.json',\n    chatGptClient: {\n        \u002F\u002F 您的 OpenAI API 密钥（用于 `ChatGPTClient`）\n        openaiApiKey: process.env.OPENAI_API_KEY || '',\n        \u002F\u002F （可选）支持补全端点的反向代理（私有 API 服务器）。\n        \u002F\u002F 警告：这会将您的 `openaiApiKey` 公开给第三方。请在使用前考虑相关风险。\n        \u002F\u002F reverseProxyUrl: 'https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions',\n        \u002F\u002F （可选）按照 https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fcompletions 的描述设置参数。\n        modelOptions: {\n            \u002F\u002F 您可以在此处覆盖模型名称及其他参数。\n            \u002F\u002F 默认模型是 `gpt-3.5-turbo`。\n            model: 'gpt-3.5-turbo',\n            \u002F\u002F 在此处设置 `max_tokens` 可以覆盖默认的 1000 个 token 的上限。\n            \u002F\u002F max_tokens: 1000,\n        },\n        \u002F\u002F （可选）Davinci 模型的最大上下文长度为 4097 个 token，但对于其他模型可能需要调整。\n        \u002F\u002F maxContextTokens: 4097,\n        \u002F\u002F （可选）如果您使用的是付费模型（如 `text-davinci-003`），可以降低此值以节省费用。\n        \u002F\u002F 系统会丢弃较早的消息，直到提示符符合限制。\n        \u002F\u002F maxPromptTokens: 3097,\n        \u002F\u002F （可选）设置自定义指令，而非默认的“您是 ChatGPT…”。\n        \u002F\u002F （可选）为用户设置自定义名称。\n        \u002F\u002F userLabel: 'User',\n        \u002F\u002F （可选）为 ChatGPT 设置自定义名称（默认为“ChatGPT”）。\n        \u002F\u002F chatGptLabel: 'Bob',\n        \u002F\u002F promptPrefix: 'You are Bob, a cowboy in Western times...',\n        \u002F\u002F 代理字符串，例如 \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F （可选）设置为 true 以启用 `console.debug()` 日志记录。\n        debug: false,\n    },\n    \u002F\u002F Bing 客户端的选项\n    bingAiClient: {\n        \u002F\u002F 对某些国家\u002F地区的用户有必要，例如中国（https:\u002F\u002Fcn.bing.com）\n        host: '',\n        \u002F\u002F 来自 bing.com 的 `_U` cookie 值\n        userToken: '',\n        \u002F\u002F 如果上述方法无效，也可以直接提供所有 cookies 的字符串。\n        cookies: '',\n        \u002F\u002F 代理字符串，例如 \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F （可选）设置为 true 以启用 `console.debug()` 日志记录。\n        debug: false,\n    },\n    chatGptBrowserClient: {\n        \u002F\u002F （可选）支持对话端点的反向代理（私有 API 服务器）。\n        \u002F\u002F 警告：这会将您的访问令牌公开给第三方。请在使用前考虑相关风险。\n        reverseProxyUrl: 'https:\u002F\u002Fbypass.churchless.tech\u002Fapi\u002Fconversation',\n        \u002F\u002F 来自 https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession 的访问令牌\n        accessToken: '',\n        \u002F\u002F 来自 chat.openai.com 的 cookies（如果使用反向代理服务器，可能不需要）。\n        cookies: '',\n        \u002F\u002F 代理字符串，例如 \"http:\u002F\u002F\u003Cip>:\u003Cport>\"\n        proxy: '',\n        \u002F\u002F （可选）设置为 true 以启用 `console.debug()` 日志记录。\n        debug: false,\n    },\n    \u002F\u002F API 服务器的选项\n    apiOptions: {\n        port: process.env.API_PORT || 3000,\n        host: process.env.API_HOST || 'localhost',\n        \u002F\u002F （可选）设置为 true 以启用 `console.debug()` 日志记录。\n        debug: false,\n        \u002F\u002F （可选）可能的选项：`chatgpt`、`chatgpt-browser`、`bing`。（默认：`chatgpt`）\n        clientToUse: 'chatgpt',\n        \u002F\u002F （可选）为每个对话生成标题（目前仅支持 ChatGPTClient）。\n        \u002F\u002F 标题将以 `title` 属性的形式返回在对话的第一条响应中。\n        generateTitles: false,\n        \u002F\u002F （可选）设置此项以允许在 POST \u002Fconversation 中更改客户端或客户端选项。\n        \u002F\u002F 若要禁用，请设置为 `null`。\n        perMessageClientOptionsWhitelist: {\n            \u002F\u002F 如果未设置 `validClientsToUse`，则无法通过 `clientOptions.clientToUse` 切换客户端。\n            \u002F\u002F 若要允许每条消息切换客户端，必须将 `validClientsToUse` 设置为非空数组。\n            validClientsToUse: ['bing', 'chatgpt', 'chatgpt-browser'], \u002F\u002F 上述可能的 `clientToUse` 选项中的值\n            \u002F\u002F 对象键，例如 `chatgpt`，是 `validClientsToUse` 中的一个值。\n            \u002F\u002F 如果未设置，则允许更改所有选项。例如，上述 `perMessageClientOptionsWhitelist` 中未定义 `bing`，\n            \u002F\u002F 因此 `bingAiClient` 的所有选项都可以被更改。\n            \u002F\u002F 如果设置了，则仅允许更改此处列出的选项。\n            \u002F\u002F 在此示例中，每个数组元素代表 `chatGptClient` 中的一个属性。\n            chatgpt: [\n                'promptPrefix',\n                'userLabel',\n                'chatGptLabel',\n                \u002F\u002F 如果在此处设置 `modelOptions.temperature`，则只能更改温度。\n                \u002F\u002F 其他选项，如 `modelOptions.model`，将不允许更改。\n                \u002F\u002F 如果希望允许更改所有 `modelOptions`，则应在此处定义 `modelOptions`，而非仅 `modelOptions.temperature`。\n                'modelOptions.temperature',\n            ],\n        },\n    },\n    \u002F\u002F CLI 应用程序的选项\n    cliOptions: {\n        \u002F\u002F （可选）可能的选项：`chatgpt`、`bing`。\n        \u002F\u002F clientToUse: 'bing',\n    },\n};\n```\n\u003C\u002Fdetails>\n\n或者，您也可以直接安装并运行该包。\n\n1. 克隆此仓库：`git clone https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api`\n2. 使用 `npm install` 安装依赖项（如果不使用 Docker）。\n3. 将根目录下的 `settings.example.js` 重命名为 `settings.js`，并根据需要修改设置。\n4. 启动服务器：\n    - 使用 `npm start` 或 `npm run server`（如果不使用 Docker）。\n    - 使用 `docker-compose up`（需要 Docker）。\n\n#### 端点\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>POST \u002Fconversation\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n开始或继续一次对话。\n可选参数仅在跨多个请求的对话中才需要。\n\n| 字段                     | 描述                                                                                                                                                                                                                                                     |\n|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| message                   | 要显示给用户的讯息。                                                                                                                                                                                                                        |\n| conversationId            | （可选）您想要继续的对话的 ID。                                                                                                                                                                                                     |\n| jailbreakConversationId   | （可选，仅适用于 `BingAIClient`）设置为 `true` 以在越狱模式下开始对话。此后，这应是越狱对话的 ID（在响应中也以名为 `jailbreakConversationId` 的参数给出）。                      |\n| parentMessageId           | （可选，适用于 `ChatGPTClient` 和越狱模式下的 `BingAIClient`）继续对话时，父消息的 ID（即 `response.messageId`）。                                                                                                  |\n| conversationSignature     | （可选，仅适用于 `BingAIClient`）对话签名（在响应中也以名为 `conversationSignature` 的参数给出）。除非处于越狱模式，否则继续对话时需要此参数。                                               |\n| clientId                  | （可选，仅适用于 `BingAIClient`）客户端 ID。除非处于越狱模式，否则继续对话时需要此参数。                                                                                                                                     |\n| invocationId              | （可选，仅适用于 `BingAIClient`）调用 ID。除非处于越狱模式，否则继续对话时需要此参数。                                                                                                                                 |\n| clientOptions             | （可选）包含客户端选项的对象。                                                                                                                                                                                                         |\n| clientOptions.clientToUse | （可选）用于此消息的客户端。可能的值：`chatgpt`、`chatgpt-browser`、`bing`。                                                                                                                                                           |\n| clientOptions.*           | （可选）任何适用于该客户端的有效选项。例如，对于 `ChatGPTClient`，您可以设置 `clientOptions.openaiApiKey` 来仅为该消息设置 API 密钥，或设置 `clientOptions.promptPrefix` 以仅为此消息向 AI 提供自定义指令等。\n\n要配置哪些选项可以按消息更改（默认：全部），请参阅 `settings.example.js` 中关于 `perMessageClientOptionsWhitelist` 的注释。\n要允许切换客户端，必须按照示例设置文件中的说明将 `perMessageClientOptionsWhitelist.validClientsToUse` 设置为非空数组。\n\u003C\u002Fdetails>\n\n#### 使用方法\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>方法 1（POST）\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n要与 ChatGPT 开始对话，请向服务器的 `\u002Fconversation` 端点发送 POST 请求，请求体为 JSON 格式，参数参照上方“端点”部分的“POST \u002Fconversation”。\n```JSON\n{\n    \"message\": \"你好，你今天过得怎么样？\",\n    \"conversationId\": \"您的对话 ID（可选）\",\n    \"parentMessageId\": \"您的父消息 ID（可选，仅适用于 `ChatGPTClient`）\",\n    \"conversationSignature\": \"您的对话签名（可选，仅适用于 `BingAIClient`）\",\n    \"clientId\": \"您的客户端 ID（可选，仅适用于 `BingAIClient`）\",\n    \"invocationId\": \"您的调用 ID（可选，仅适用于 `BingAIClient`）\"\n}\n```\n服务器将返回一个包含 ChatGPT 回答的 JSON 对象：\n```JS\n\u002F\u002F HTTP\u002F1.1 200 OK\n{\n    \"response\": \"我很好，谢谢！你呢？\",\n    \"conversationId\": \"您的对话 ID\",\n    \"messageId\": \"响应消息 ID（仅适用于 `ChatGPTClient`）\",\n    \"conversationSignature\": \"您的对话签名（仅适用于 `BingAIClient`）\",\n    \"clientId\": \"您的客户端 ID（仅适用于 `BingAIClient`）\",\n    \"invocationId\": \"您的调用 ID（仅适用于 `BingAIClient`——请将此新值原样传递回后续请求中）\",\n    \"details\": \"包含来自客户端原始响应的对象\"\n}\n```\n\n如果请求失败，服务器将返回带有错误信息的 JSON 对象。\n\n如果请求对象缺少必填字段（例如 `message`）：\n```JS\n\u002F\u002F HTTP\u002F1.1 400 Bad Request\n{\n    \"error\": \"必须提供 message 参数。\"\n}\n```\n\n如果向 ChatGPT 发送消息时出现错误：\n```JS\n\u002F\u002F HTTP\u002F1.1 503 Service Unavailable\n{\n    \"error\": \"与 ChatGPT 通信时发生错误。\"\n}\n```\n\u003C\u002Fdetails>\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>方法 2（SSE）\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n您可以在请求体中设置 `\"stream\": true`，以在标记生成时接收流式输出。\n\n```js\nimport { fetchEventSource } from '@waylaidwanderer\u002Ffetch-event-source'; \u002F\u002F 如果在浏览器环境中，请改用 `@microsoft\u002Ffetch-event-source`\n\nconst opts = {\n    method: 'POST',\n    headers: {\n        'Content-Type': 'application\u002Fjson',\n    },\n    body: JSON.stringify({\n        \"message\": \"写一首关于猫的诗。\",\n        \"conversationId\": \"您的对话 ID（可选）\",\n        \"parentMessageId\": \"您的父消息 ID（可选）\",\n        \"stream\": true,\n        \u002F\u002F 其他所有参数均参照上方“端点 > POST \u002Fconversation”\n    }),\n};\n```\n\n有关如何在响应生成时接收响应的示例，请参阅 [demos\u002Fuse-api-server-streaming.js](demos\u002Fuse-api-server-streaming.js)。您将一次收到一个标记，因此需要自行将其拼接起来。\n\n成功输出：\n```JS\n{ data: '', event: '', id: '', retry: 3000 }\n{ data: 'Hello', event: '', id: '', retry: undefined }\n{ data: '!', event: '', id: '', retry: undefined }\n{ data: ' How', event: '', id: '', retry: undefined }\n{ data: ' can', event: '', id: '', retry: undefined }\n{ data: ' I', event: '', id: '', retry: undefined }\n{ data: ' help', event: '', id: '', retry: undefined }\n{ data: ' you', event: '', id: '', retry: undefined }\n{ data: ' today', event: '', id: '', retry: undefined }\n{ data: '?', event: '', id: '', retry: undefined }\n{ data: '\u003Cresult JSON here, see Method 1>', event: 'result', id: '', retry: undefined }\n{ data: '[DONE]', event: '', id: '', retry: undefined }\n\u002F\u002F Hello! How can I help you today?\n```\n\n错误输出：\n```JS\nconst message = {\n  data: '{\"code\":503,\"error\":\"There was an error communicating with ChatGPT.\"}',\n  event: 'error',\n  id: '',\n  retry: undefined\n};\n\nif (message.event === 'error') {\n  console.error(JSON.parse(message.data).error); \u002F\u002F There was an error communicating with ChatGPT.\n}\n```\n\u003C\u002Fdetails>\n\n#### 注意事项\n- 方法一简单易行，但首字节时间（TTFB）较长。\n- 方法二使用了非标准的 [服务器发送事件 API](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events\u002FUsing_server-sent_events) 实现；你需要先导入 `fetch-event-source` 库，并使用 `POST` 方法。\n\n\n\n### 命令行工具\n\n#### 设置\n请按照 API 服务器的[设置说明](#api-server-setup)进行操作，创建 `settings.js` 文件。\n\n#### 使用\n如果已全局安装：\n```bash\nchatgpt-cli\n```\n\n如果仅在本地安装：\n```bash\nnpm run cli\n```\n\nChatGPT 的回复会自动复制到剪贴板，方便你将其粘贴到其他应用程序中。\n\n## 使用反向代理\n如上文示例所示，你可以在 `ChatGPTClient` 的选项中设置 `reverseProxyUrl`，以使用反向代理服务器代替官方的 ChatGPT API。\n~~目前，**这是唯一可以使用 ChatGPT 底层模型的方式**。~~ 此方法已被修复，以下说明已不再适用，但你仍可能出于其他原因选择使用反向代理。\n目前，反向代理服务器仍然被用于为 `ChatGPTBrowserClient` 进行 Cloudflare 绕过。\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>说明\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n它是如何工作的呢？简单来说：`ChatGPTClient` > 反向代理 > OpenAI 服务器。反向代理服务器会在后台执行一些特殊操作，直接通过 OpenAI 的服务器访问底层模型，然后将响应返回给 `ChatGPTClient`。\n\n以下是具体步骤。\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions\u003C\u002Fstrong>（我的服务，\u003Cstrong>目前已离线\u003C\u002Fstrong>)\u003C\u002Fsummary>\n\n#### 指导步骤\n1. 从 https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession 获取你的 ChatGPT 访问令牌（查找 `accessToken` 属性）。\n    * **这与 _会话令牌_ 不同。**\n    * 目前该库尚不支持自动获取或刷新 ChatGPT 访问令牌，请暂时由你自己处理。\n2. 在 `settings.js > chatGPTClient` 或 `ChatGPTClient` 的选项中，将 `reverseProxyUrl` 设置为 `https:\u002F\u002Fchatgpt.hato.ai\u002Fcompletions`。\n3. 将“OpenAI API 密钥”参数（例如 `settings.chatGPTClient.openaiApiKey`）设置为你在第 1 步中获得的 ChatGPT 访问令牌。\n4. 根据你的账户可访问的 ChatGPT 模型，将 `model` 设置为 `text-davinci-002-render`、`text-davinci-002-render-paid` 或 `text-davinci-002-render-sha`。模型名称必须是 ChatGPT 的正式名称，而非底层模型名称，且不能选择你账户无权使用的模型。\n    * 你可以通过打开开发者工具并进入网络标签页来确认自己拥有哪些模型权限。刷新页面后，查看 https:\u002F\u002Fchat.openai.com\u002Fbackend-api\u002Fmodels 的响应体。\n\n#### 注意事项\n- 由于这是我的服务器，我可以保证不会进行任何日志记录或跟踪。我只能看到总体的使用统计数据，而无法查看你的任何请求内容。至于是否信任我，则取决于你自己。\n- 不支持超过 60 秒的非流式响应。可使用 `stream: true`（API）或 `onProgress`（客户端）作为替代方案。\n- 请求频率限制为每秒 10 次。\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\u003Csummary>\u003Cstrong>https:\u002F\u002Fchatgpt.pawan.krd\u002Fapi\u002Fcompletions\u003C\u002Fstrong> (@PawanOsmon，\u003Cstrong>目前已离线\u003C\u002Fstrong>)\u003C\u002Fsummary>\n\n#### 指导步骤\n1. 从 https:\u002F\u002Fchat.openai.com\u002Fapi\u002Fauth\u002Fsession 获取你的 ChatGPT 访问令牌（查找 `accessToken` 属性）。\n    * **这与 _会话令牌_ 不同。**\n    * 目前该库尚不支持自动获取或刷新 ChatGPT 访问令牌，请暂时由你自己处理。\n2. 在 `settings.js > chatGPTClient` 或 `ChatGPTClient` 的选项中，将 `reverseProxyUrl` 设置为 `https:\u002F\u002Fchatgpt.pawan.krd\u002Fapi\u002Fcompletions`。\n3. 将“OpenAI API 密钥”参数（例如 `settings.chatGPTClient.openaiApiKey`）设置为你在第 1 步中获得的 ChatGPT 访问令牌。\n4. 根据你的账户可访问的 ChatGPT 模型，将 `model` 设置为 `text-davinci-002-render`、`text-davinci-002-render-paid` 或 `text-davinci-002-render-sha`。模型名称必须是 ChatGPT 的正式名称，而非底层模型名称，且不能选择你账户无权使用的模型。\n    * 你可以通过打开开发者工具并进入网络标签页来确认自己拥有哪些模型权限。刷新页面后，查看 https:\u002F\u002Fchat.openai.com\u002Fbackend-api\u002Fmodels 的响应体。\n\n#### 注意事项\n- 不支持超过 60 秒的非流式响应。可使用 `stream: true`（API）或 `onProgress`（客户端）作为替代方案。\n- 请求频率限制为每 15 秒 50 次。\n\u003C\u002Fdetails>\n\u003C\u002Fdetails>\n\n## 项目\n🚀 使用 `@waylaidwanderer\u002Fchatgpt-api` 的精彩项目列表：\n- [PandoraAI](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002FPandoraAI)：由 node-chatgpt-api 驱动的我的网页聊天客户端，允许用户轻松与多个 AI 系统对话，同时支持自定义预设。凭借其流畅便捷的设计，PandoraAI 提供了引人入胜的对话式 AI 体验。\n- [LibreChat](https:\u002F\u002Fgithub.com\u002Fdanny-avila\u002Fchatgpt-clone)：集成了 ChatGPT 技术，支持多种 AI 模型、对话功能、消息搜索和插件。它提供免费\u002F按调用付费的 API，无需订阅 ChatGPT Plus，并支持个性化定制。\n- [ChatGPT WebApp](https:\u002F\u002Fgithub.com\u002Ffrontend-engineering\u002Fchatgpt-webapp-fullstack)：一个具有移动端兼容界面的全栈聊天 Web 应用，后端使用 node-chatgpt-api。任何人都可以部署属于自己的聊天服务。\n- [halbot](https:\u002F\u002Fgithub.com\u002FLeask\u002Fhalbot)：又一个基于 ChatGPT\u002FBing Chat 的 Telegram 机器人，设计简洁、易于使用、可扩展且充满乐趣。\n- [ChatGPTBox](https:\u002F\u002Fgithub.com\u002FjosStorer\u002FchatGPTBox)：将 ChatGPT 深度集成到你的浏览器中，你所需的一切尽在这里。\n- [llm-bot](https:\u002F\u002Fgithub.com\u002FErisfiregamer1\u002Fllm-bot)：一款用于 LLM 聊天的 Discord 机器人。附带一个 GPT-4 的自定义反向代理，使其能够免费访问（感谢“generic”！）。\n- [WhatsAppSydney](https:\u002F\u002Fgithub.com\u002Fveigamann\u002Fsydney-whatsapp-chatbot)：基于 Bing 的 WhatsApp 个人助理。轻松简化你的日常生活。\n\n通过 [编辑此 README](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fedit\u002Fmain\u002FREADME.md) 并创建拉取请求，将你的项目加入列表吧！\n\n## 网页客户端\n本项目的网页客户端也可在 [waylaidwanderer\u002FPandoraAI](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002FPandoraAI) 上找到。\n\n## 注意事项\n### 关于 `ChatGPTClient`\n由于 `gpt-3.5-turbo` 是 ChatGPT 的底层模型，我尽力复现了官方 ChatGPT 网站对其的使用方式。\n这意味着我的实现或底层模型在某些方面可能表现不完全一致：\n- 对话不会绑定到任何用户 ID，因此如果你对此有要求，建议自行实现用户 ID 系统。\n- ChatGPT 的模型参数（温度、频率惩罚等）未知，所以我设置了一些我认为合理的默认值。\n- 对话仅保留最近约 3000 个 token 的内容，因此在长时间对话中，较早的消息可能会被遗忘。\n    - 这种机制与 ChatGPT 类似，不过我确信 ChatGPT 在需要时会有其他方式来检索早期上下文信息（这通常可以通过嵌入技术实现，但我暂时认为这超出了当前范围）。\n\n## 贡献\n如果你想为本项目做出贡献，请提交包含详细变更说明的拉取请求。\n\n## 许可证\n本项目采用 MIT 许可证授权。","# node-chatgpt-api 快速上手指南\n\n`node-chatgpt-api` 是一个功能强大的 Node.js 客户端，支持调用官方 ChatGPT 模型 (`gpt-3.5-turbo`)、Bing AI (GPT-4) 以及通过反向代理访问 ChatGPT 网页版。它提供了模块引用、REST API 服务和命令行工具三种使用方式。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **Node.js**: 版本 >= 16.0.0\n*   **包管理器**: npm\n*   **API 密钥**: [OpenAI API Key](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys) (用于调用官方模型)\n*   **Docker** (可选): 如果您打算部署独立的 API 服务器\n\n> **国内开发者提示**：由于网络环境限制，访问 OpenAI 服务通常需要配置科学上网环境或使用国内可用的反向代理服务。\n\n## 安装步骤\n\n### 1. 作为 Node.js 模块安装（推荐用于开发）\n\n在项目目录中运行以下命令安装依赖：\n\n```bash\nnpm i @waylaidwanderer\u002Fchatgpt-api\n```\n\n> **加速建议**：如果下载缓慢，可使用淘宝镜像源：\n> ```bash\n> npm i @waylaidwanderer\u002Fchatgpt-api --registry=https:\u002F\u002Fregistry.npmmirror.com\n> ```\n\n### 2. 全局安装（用于 CLI 或 API 服务器）\n\n如果您想直接使用命令行工具或启动全局 API 服务：\n\n```bash\nnpm i -g @waylaidwanderer\u002Fchatgpt-api\n```\n\n## 基本使用\n\n### 方式一：在代码中作为模块使用\n\n这是最灵活的方式，适合集成到您的应用中。以下是一个使用官方 `gpt-3.5-turbo` 模型的最简示例：\n\n1.  创建文件 `index.js`：\n\n```javascript\nconst { ChatGPTClient } = require('@waylaidwanderer\u002Fchatgpt-api');\n\n\u002F\u002F 初始化客户端\nconst client = new ChatGPTClient('YOUR_OPENAI_API_KEY');\n\nasync function main() {\n    const message = '你好，请介绍一下你自己';\n    \n    \u002F\u002F 发送消息并获取回复\n    const response = await client.sendMessage(message);\n    \n    console.log(response.text);\n}\n\nmain().catch(console.error);\n```\n\n2.  设置环境变量并运行：\n\n```bash\nexport OPENAI_API_KEY=\"sk-...\" # Windows 请使用 set OPENAI_API_KEY=sk-...\nnode index.js\n```\n\n### 方式二：使用命令行工具 (CLI)\n\n安装全局包后，您可以直接在终端与 AI 对话：\n\n1.  设置 API 密钥环境变量：\n    ```bash\n    export OPENAI_API_KEY=\"sk-...\"\n    ```\n\n2.  启动对话：\n    ```bash\n    chatgpt-api\n    ```\n\n### 方式三：启动 REST API 服务器\n\n您可以启动一个本地 HTTP 服务，供非 Node.js 应用（如 Python、Go 或前端项目）调用：\n\n1.  创建配置文件 `settings.js` (参考项目中的 `settings.example.js`)，填入您的 API Key。\n2.  启动服务：\n    ```bash\n    chatgpt-api --settings=.\u002Fsettings.js\n    ```\n    默认服务将运行在 `http:\u002F\u002Flocalhost:3000`。\n\n## 注意事项\n\n*   **模型选择**：默认使用 `gpt-3.5-turbo` 模型，该模型按量计费但性价比极高。\n*   **账号安全**：若使用 `ChatGPTBrowserClient` 自动化操作网页版 ChatGPT，存在账号被封禁的风险，请谨慎使用。\n*   **反向代理**：在国内使用时，可在配置中设置 `reverseProxyUrl` 以绕过网络限制，但需注意第三方代理的安全性风险。","某初创公司的后端团队希望将智能客服对话功能集成到现有的 Node.js 订单系统中，以自动处理用户关于物流状态的咨询。\n\n### 没有 node-chatgpt-api 时\n- 开发人员必须手动编写复杂的浏览器自动化脚本（如 Puppeteer）来模拟网页操作，代码维护成本极高且容易因官网界面微调而崩溃。\n- 无法直接调用最新的 `gpt-3.5-turbo` 模型，只能依赖昂贵且响应较慢的旧版 `text-davinci-003`，导致单次查询成本高出 10 倍。\n- 缺乏统一的接口封装，团队需要在 REST API 服务、命令行工具和内部模块之间重复造轮子，开发效率低下。\n- 面对官方接口的频繁变动和封号风险，缺乏灵活的逆向代理或 Token 管理机制，系统稳定性难以保障。\n\n### 使用 node-chatgpt-api 后\n- 直接通过简单的 Node.js 模块导入即可集成对话能力，无需维护脆弱的浏览器自动化流程，系统稳定性显著提升。\n- 默认支持高性价比的 `gpt-3.5-turbo` 模型，在保持高质量回答的同时，将 API 调用成本降低了 90%。\n- 利用其内置的 REST API 服务器和 CLI 应用特性，团队可快速在不同微服务和调试场景中复用同一套逻辑，大幅缩短开发周期。\n- 灵活切换官方 API 或配置逆向代理服务器，有效规避了直接自动化网页带来的账号封禁风险，确保持续可用。\n\nnode-chatgpt-api 通过提供统一、低成本且稳定的接入方案，让开发者能专注于业务逻辑而非底层对接细节，迅速实现智能对话功能的落地。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fwaylaidwanderer_node-chatgpt-api_82928377.png","waylaidwanderer","Joel","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fwaylaidwanderer_5659a5ca.jpg",null,"jcz.dev","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer",[79,83],{"name":80,"color":81,"percentage":82},"JavaScript","#f1e05a",99.9,{"name":84,"color":85,"percentage":86},"Dockerfile","#384d54",0.1,4180,720,"2026-04-12T13:40:07","MIT","Linux, macOS, Windows","未说明",{"notes":94,"python":95,"dependencies":96},"这是一个 Node.js 库，不需要 Python 或 GPU。主要依赖是 Node.js 16+ 和 npm。可选使用 Docker 部署 API 服务器。使用官方 OpenAI API 需要付费密钥；若使用逆向代理访问 chat.openai.com 存在账号被封禁风险。对话默认存储在内存中，可配置适配器持久化到数据库或 JSON 文件。","不适用 (基于 Node.js)",[97,98,99,100,101],"Node.js >= 16.0.0","npm","keyv","keyv-file","@waylaidwanderer\u002Fchatgpt-api",[52,16,13,35],[104,105,106,107,108,109,110,111,112,113,98,114,115,116,117,118,119,120],"chatgpt","chatgpt-api","gpt","openai","openai-api","api","api-rest","api-server","cli","nodejs","javascript","bing","bing-api","bing-search","gpt-3","gpt-4","bing-chat","2026-03-27T02:49:30.150509","2026-04-13T13:37:43.385945",[124,129,134,139,144,149],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},31542,"Sydney (Bing) 总是重复之前的回答内容，即使我要求它不要这样做，如何限制？","这个问题通常是因为 BingAIClient 不断创建新会话导致的。请确保你已更新到最新版本（该问题已在 PR #350 中修复）。如果问题依旧，检查是否每次请求都正确复用了会话上下文，而不是意外重置了会话。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F289",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},31541,"Bing Jailbreak 功能突然失效并出现 403 错误或重定向怎么办？","尝试以下解决方法：\n1. 删除配置文件 setting.js 中的 'x-forward-for' 字段。\n2. 确保配置的是完整的 Cookie 字符串，而不仅仅是 user token (_U)。有时仅配置 _U 值是不够的，需要复制浏览器中 \u002Fturing\u002Fconversation\u002Fcreate 请求里的整串 Cookie。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F378",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},31539,"遇到 'failed to parse response body' 或 'Unexpected token \u003C in JSON' 错误怎么办？","这通常是因为请求被 Bing 拦截或 Cookie 过期。解决方案如下：\n1. 设置代理：在 BingAIClient 参数或 settings.js 的 bingAiClient 配置中添加 proxy。\n2. 更新 Cookie：在浏览器中向 Bing 发送一条消息，打开开发者工具（Dev Tools），找到网络请求 `\u002Fturing\u002Fconversation\u002Fcreate`，复制该请求头中的完整 Cookie 值（不仅仅是 _U 值，需要整个长字符串）并替换配置中的 Cookie。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F205",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},31540,"提示 'UnauthorizedRequest: Sorry, you are not allowed to access this service' 或 Cookie 无效如何解决？","这是因为使用的 Cookie 不正确或不完整。获取正确 Cookie 的方法是：\n1. 打开浏览器开发者工具（F12）。\n2. 访问 Bing 并发送一条消息。\n3. 在 Network（网络）标签页中找到 Fetch\u002FXHR 请求。\n4. 点击该请求，在 \"Request Headers\"（请求头）部分复制完整的 \"Cookie\" 值。\n5. 将复制的值填入配置文件中。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F79",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},31543,"程序运行一段时间后出现内存泄漏（Memory Leak），内存占用从几十 MB 增长到几 GB 怎么办？","维护者已发布更新优化了 Token 计数算法以解决此问题。请将库升级到最新版本（例如 @waylaidwanderer\u002Fchatgpt-api@1.25.7 或更高），升级后内存占用应保持稳定，不再随对话数量增加而异常增长。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F153",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},31544,"反向代理（Reverse Proxy）网站失效或无法连接怎么办？","由于为了防止被 OpenAI\u002FBing 修补，反向代理的具体代码和方法是私有的，无法开源。如果遇到反向代理失效，请确保你已经更新到了该库的最新版本，因为维护者会在新版本中更新内置的反向代理地址或修复相关连接逻辑。","https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F63",[155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250],{"id":156,"version":157,"summary_zh":158,"released_at":159},238738,"v1.37.0","## 变更内容\n* 修复(bing)：由 @fuegovic 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F372 中延长消息超时时间\n* 新特性(client)：由 @danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F380 中添加对选项对象中自定义头部的支持\n* 新特性(client)：由 @Leask 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F308 中新增会话覆盖、会话返回以及仅保留必要消息的功能\n* 杂项：由 @oskardotglobal 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F335 中重写 Dockerfile\n* 新特性(bing)：由 @timefox 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F381 中添加图像生成功能\n\n## 新贡献者\n* @fuegovic 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F372 中完成了首次贡献\n* @oskardotglobal 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F335 中完成了首次贡献\n* @timefox 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F381 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.36.0...v1.37.0","2023-05-31T21:32:30",{"id":161,"version":162,"summary_zh":163,"released_at":164},238739,"v1.36.0","## 变更内容\n* 功能：@syedahmedhaidershah 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F291 中为服务器和 CLI 添加了 Nodemon 检查功能。\n* 功能（Bing）：@Erisfiregamer1 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F317 中改为接受 Keyv 对象而非选项对象。\n* 修复（服务器）：@Argyropus 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F319 中允许从请求体中传递 systemMessage 和 context。\n* 文档（README）：@Erisfiregamer1 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F325 中添加了 llm-bot 的说明。\n* 杂项：@hibobmaster 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F312 中将 Docker 镜像推送到 GitHub 容器仓库。\n* 修复（Bing）：@zhouxinhao1208 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F352 中正确实例化 HttpsProxyAgent。\n* 修复（Bing）：@InterestingDarkness 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F350 中解决了因消息字符串为空而导致的重复介绍问题，并改用更原生的方法传递网页上下文。\n* 修复（Bing）：@kq514550 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F360 中在 Bing 致歉时使用 replySoFar。\n* 功能（浏览器客户端）：@Trinculo54 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F344 中新增了 deleteConversation 函数。\n* 功能（ChatGPTClient.js）：@danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F361 中增加了通过 API 密钥支持 Azure 的功能。\n\n## 新贡献者\n* @syedahmedhaidershah 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F291 中完成了首次贡献。\n* @Argyropus 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F319 中完成了首次贡献。\n* @hibobmaster 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F312 中完成了首次贡献。\n* @zhouxinhao1208 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F352 中完成了首次贡献。\n* @kq514550 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F360 中完成了首次贡献。\n* @Trinculo54 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F344 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.35.0...v1.36.0","2023-05-16T04:40:42",{"id":166,"version":167,"summary_zh":168,"released_at":169},238740,"v1.35.0","## 变更内容\n* 修复(bing)：修复越狱模式下的上下文输入问题，并解决重复介绍的问题，由 @InterestingDarkness 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F256 中完成。\n* 构建(deps-dev)：将 eslint 从 8.36.0 升级到 8.37.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F258 中完成。\n* 修复：更新示例中的 reverseProxyUrl，提醒大家注意 duti.tech 的安全问题，由 @danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F269 中完成。\n* 修复(bing)：尝试修复因“文档上下文中当前用户消息”引起的所有问题，由 @InterestingDarkness 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F264 中完成。\n* 构建(deps-dev)：将 @keyv\u002Fredis 从 2.5.6 升级到 2.5.7，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F272 中完成。\n* 修复(bing)：在越狱模式下，将真实用户消息替换为空字符串，由 @notenough1111 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F277 中完成。\n* 构建(deps)：将 @dqbd\u002Ftiktoken 从 1.0.2 升级到 1.0.3，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F279 中完成。\n* 将 genTitle 方法改为异步，并以 Promise 形式添加到响应对象中，由 @danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F280 中完成。\n* 构建(deps)：将 @dqbd\u002Ftiktoken 从 1.0.3 升级到 1.0.4，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F300 中完成。\n* 构建(deps)：将 undici 从 5.21.0 升级到 5.21.2，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F299 中完成。\n* 构建(deps-dev)：将 eslint 从 8.37.0 升级到 8.38.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F298 中完成。\n* 功能(ChatGPTBrowserClient)：为浏览器客户端添加可选的 onEventMessage 参数，由 @danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F297 中完成。\n\n## 新贡献者\n* @danny-avila 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F269 中完成了首次贡献。\n* @notenough1111 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F277 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.33.0...v1.35.0","2023-04-12T08:14:21",{"id":171,"version":172,"summary_zh":173,"released_at":174},238741,"v1.33.0","## 变更内容\n\n### 修复\n- 修复了在越狱模式下，Bing AI 不使用用户语言的问题，由 @today- 在 [#229](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F229) 中完成。\n- 修复了 Bing 中 WebSocket 连接错误事件未被捕获的问题，由 @ropoctl 在 [#240](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F240) 中完成。\n- 检查 IP 是否被 Bing 屏蔽，并分别在 [#244](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F244) 和 [#230](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fissues\u002F230) 中添加了因地理位置导致请求被屏蔽的解决方案，由 @likev 完成。\n- 在设置属性之前，处理 Bing 中 eventMessage 为 null 的情况，由 @dependabot 在 [#247](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F247) 中完成。\n\n### 构建\n- 将 ora 从 6.2.0 升级到 6.3.0，由 @dependabot 在 [#237](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F237) 中完成。\n\n### 文档\n- 在 README 中将 ChatGPTBox 添加到“项目”部分，由 @josStorer 在 [#243](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F243) 中完成。\n\n### 功能\n- 在 Bing 中将对话置于“文档摘要”上下文中，由 @InterestingDarkness 在 [#246](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F246) 中完成。\n- 允许在 API 服务器中通过请求覆盖 shouldGenerateTitle 的默认值。\n\n### 杂项\n- 更新了 chatgpt-browser 中的绕过 URL。\n\n## 新贡献者\n- @today- 在 [#229](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F229) 中完成了首次贡献。\n- @ropoctl 在 [#240](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F240) 中完成了首次贡献。\n- @josStorer 在 [#243](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F243) 中完成了首次贡献。\n\n**完整变更日志**: [v1.32.0...v1.33.0](https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.32.0...v1.33.0)","2023-03-27T22:47:40",{"id":176,"version":177,"summary_zh":178,"released_at":179},238742,"v1.32.0","## 简而言之\n- Bing：重新启用对系统消息的支持\n- Bing：新增对上下文消息和快速“平衡”模式的支持\n- 升级了 fastify、inquirer 和 ora 依赖\n- 其他一些小修复\n\n## 变更内容\n* build(deps)：将 @dqbd\u002Ftiktoken 从 0.4.0 升级至 1.0.2，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F200 中完成\n* fix(bing)：改进错误处理，由 @likev 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F198 中完成\n* feat(bing)：添加 systemMessage，由 @Erisfiregamer1 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F199 中完成\n* build(deps)：将 ora 从 6.1.2 升级至 6.2.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F218 中完成\n* build(deps)：将 inquirer 从 9.1.4 升级至 9.1.5，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F219 中完成\n* build(deps)：将 fastify 从 4.14.1 升级至 4.15.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F220 中完成\n* feat(bing)：添加对上下文消息（含示例）和快速“平衡”模式的支持，由 @dene- 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F216 中完成\n* feat(bing)：重新启用对系统消息的支持，由 @InterestingDarkness 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F214 中完成\n\n## 新贡献者\n* @Erisfiregamer1 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F199 中完成了首次贡献\n* @dene- 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F216 中完成了首次贡献\n* @InterestingDarkness 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F214 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.31.0...v1.32.0","2023-03-21T22:33:08",{"id":181,"version":182,"summary_zh":183,"released_at":184},238743,"v1.31.0","## 变更内容\n* docs(readme): 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F184 中，@Leask 添加了 halbot 说明\n* build(deps-dev): @dependabot 将 eslint 从 8.35.0 升级至 8.36.0，在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F185 中完成\n* build(deps): @dependabot 将 undici 从 5.20.0 升级至 5.21.0，在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F186 中完成\n* build(deps): @dependabot 将 @fastify\u002Fcors 从 8.2.0 升级至 8.2.1，在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F188 中完成\n* feat(bing): @waylaidwanderer 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F204 中实现了 jailbreak redux 功能\n\n## 其他\n* chore(bing): 更新了请求头，以匹配最新的 Edge Dev 请求\n* feat(client): 正式支持 `gpt-4` 模型（由于此次为小版本更新，且不认为其特别重要，因此未发布 GitHub Release）\n\n## 新贡献者\n* @Leask 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F184 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.29.0...v1.31.0","2023-03-18T04:16:13",{"id":186,"version":187,"summary_zh":188,"released_at":189},238744,"v1.29.0","## 变更内容\n* 修复（服务端）：修复会话缓存问题，由 @TNTcraftHIM 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F175 中完成\n* 构建（依赖）：将 ws 从 8.12.1 升级至 8.13.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F179 中完成\n* 功能（README）：在项目列表中添加我的 Web 应用客户端程序，由 @walkthunder 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F182 中完成\n* 功能（客户端）：增加为对话生成标题的功能，由 @waylaidwanderer 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F183 中完成\n* 修复（客户端）：如果可用，也在响应中包含 parentMessageId\n\n## 新贡献者\n* @TNTcraftHIM 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F175 中完成了首次贡献\n* @walkthunder 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F182 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.28.0...v1.29.0","2023-03-13T00:10:55",{"id":191,"version":192,"summary_zh":193,"released_at":194},238745,"v1.28.0","## 功能\n* feat: 每条消息的客户端选项，由 @waylaidwanderer 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F173 中实现\n\n## 修复\n- 向项目中添加了 ESLint，并修复了所有 linting 错误\n\n## 其他\n- 在 README 中新增了“Projects”章节，你可以在其中添加使用本库开发的项目\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.27.0...v1.28.0","2023-03-08T07:23:04",{"id":196,"version":197,"summary_zh":198,"released_at":199},238746,"v1.27.0","## 功能\n* 悉尼 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F132\n\n## 其他\n* 构建（依赖）：将 fastify 从 4.14.0 升级到 4.14.1，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F169 中完成\n\n**完整更新日志**：https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.26.0...v1.27.0","2023-03-07T21:45:57",{"id":201,"version":202,"summary_zh":203,"released_at":204},238747,"v1.26.0","## 功能特性\n\n- 增加代理选项和“生成标题”请求，由 @hyperzlib 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F146 中提出\n- 更新了 README 和示例配置\n- 将默认模型设置为 `gpt-3.5-turbo`\n- 优化了令牌计数算法\n- 修复了 `gpt-3.5-turbo` 越狱模式下的多种问题（提示前缀、结束标记、分词器以及伪令牌）\n\n## 新贡献者\n* @hyperzlib 在 https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F146 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.25.0...v1.26.0","2023-03-06T00:30:03",{"id":206,"version":207,"summary_zh":208,"released_at":209},238748,"v1.25.0","## Features\r\n- client(gpt-3.5-turbo): overhauled logic for building the messages payload, which seems more reliable, especially for keeping the AI in character. It also seems to improve coherency and context retention.\r\n  - Note: if you started to use `messagesPrefix` introduced in 1.24.0, well, I yeeted it due to the above. Just put your stuff in `promptPrefix` as usual.\r\n\r\n## Other\r\n* build(deps): bump fastify from 4.13.0 to 4.14.0 by @dependabot in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F151\r\n* build(deps): bump boxen from 7.0.1 to 7.0.2 by @dependabot in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F150\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.23.0...v1.25.0","2023-03-04T00:23:21",{"id":211,"version":212,"summary_zh":213,"released_at":214},238749,"v1.23.0","## Features\r\n- BingAIClient: support choosing a conversation style by @likev in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F141\r\n\r\n## Patches\r\n- 1.22.5\r\n  - fix(client): make use of the name property for messages\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.22.0...v1.23.0","2023-03-03T00:53:33",{"id":216,"version":217,"summary_zh":218,"released_at":219},238750,"v1.22.0","## Features\r\n- official ChatGPT API support by @waylaidwanderer in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F137\r\n  - to use it, set `modelOptions.model` to `gpt-3.5-turbo`, and `ChatGPTClient` will handle the rest\r\n  - you can still set `userLabel`, `chatGptLabel` and `promptPrefix` (system instructions) as usual\r\n\r\n## Patches\r\n- 1.21.3\r\n  - fix(client): automatically set maxPromptTokens based on maxContextTokens and maxResponseTokens\r\n- 1.21.2\r\n  - fix(bing): update message options to match payload on website\r\n  - feat: implement ability to abort request in clients\r\n- 1.21.1\r\n  - docs(readme): add link to web client\r\n  - docs(readme): minor tweaks Joel\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.21.0...v1.22.0","2023-03-01T22:09:04",{"id":221,"version":222,"summary_zh":223,"released_at":224},238751,"v1.21.0","## Fixes\r\n**BREAKING CHANGES**:\r\n- api: JSON-encode tokens when streaming to retain characters such as newlines properly\r\n\r\nNon-breaking:\r\n- client\u002Fbrowser-client: Don't attempt to parse ping events\r\n- client: Set headers timeout to 3 minutes\r\n- browser-client: Ignore any messages not from assistant role\r\n- browser-client: Handle non-existent conversation IDs when fetching cache\r\n- browser-client: Handle null lastEvent on close, fixes #98, #99\r\n- api: Use setTimeout instead of nextTick to avoid ERR_STREAM_WRITE_AFTER_END\r\n- api: Use my sse fork to avoid sending unnecessary retryAfter event\r\n- api: Don't send [DONE] twice\r\n- bing: Handle invalid session error, fixes #90\r\n\r\n## Misc.\r\n- cli: Explicitly set bin files to LF, fixes #51\r\n- docs: Reformat example settings a little bit\r\n- docs: Replace examples already in demos folder with link\r\n- docs: Add clarification on how maxPromptTokens works\r\n\r\n## New Contributors\r\n* @ryanwy made their first contribution in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F100\r\n* @gengjiawen made their first contribution in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F117\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.20.0...v1.21.0","2023-02-27T07:38:24",{"id":226,"version":227,"summary_zh":228,"released_at":229},238752,"v1.20.0","## Features\r\n- **ChatGPTClient**: add the ability to limit token usage\r\n\r\n## Fixes\r\n- **ChatGPTClient**: add raw response under details property\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.19.0...v1.20.0","2023-02-20T04:28:48",{"id":231,"version":232,"summary_zh":233,"released_at":234},238753,"v1.19.0","## What's Changed\r\n* feat(bing): custom configuration host by @yuwangi in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F88\r\n* refactor: use fetch-undici instead of node-fetch by @Songkeys in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F72\r\n* feat(client): send final result when stream is true by @likev in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F87\r\n* feat: add experimental ChatGPT browser client by @waylaidwanderer in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F95\r\n* feat(bing): add proxy support\r\n\r\n## New Contributors\r\n* @yuwangi made their first contribution in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F88\r\n* @Songkeys made their first contribution in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F72\r\n* @likev made their first contribution in https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fpull\u002F87\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.17.2...v1.19.0","2023-02-18T21:01:07",{"id":236,"version":237,"summary_zh":238,"released_at":239},238754,"v1.17.2","## 1.17.2\r\n- Fixed a bug where the Bing cookies value was not used in CLI\u002Fserver. This should actually resolve #79 this time.\r\n\r\n## 1.17.1\r\n- **Bing**: Fixed a bug where the websocket connection was not cleaned up before timing out\r\n\r\n## 1.17.0\r\n- **CLI**: added support for resuming existing Bing conversations\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.16.5...v1.17.2","2023-02-16T00:22:52",{"id":241,"version":242,"summary_zh":243,"released_at":244},238755,"v1.16.5","## Features\r\n- Support setting entire cookie string for Bing chat mode, fixes #79 (necessary for users who have a `KievRPSSecAuth` cookie)\r\n\r\n## Bug Fixes\r\n\r\n- Fixed error detection for Bing client messages\r\n- Throw an error if no message is received in 2 minutes for Bing chat mode\r\n\r\n## Dependencies\r\n\r\n- Bump ws from 8.12.0 to 8.12.1 (#75)\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.16.0...v1.16.5","2023-02-15T08:20:43",{"id":246,"version":247,"summary_zh":248,"released_at":249},238756,"v1.16.0","## Features\r\n- **cli**: CLI now uses Bing's adaptive card's text when rendering the final response (which includes sources)\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.15.3...v1.16.0","2023-02-14T02:13:38",{"id":251,"version":252,"summary_zh":253,"released_at":254},238757,"v1.15.3","## Features\r\n- **demo**: Replaced demo with a gif animation\r\n- **readme**: Added reverse proxy information to the readme\r\n\r\n## Fixes\r\n- **client**: Resolved the issue of parsing empty data\r\n- **client**: Improve response behavior by using the end token instead of the separator token\r\n- **cli**: Fixed ChatGPT conversations not being resumable\r\n- **demos**: Corrected the package import in the demos\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fwaylaidwanderer\u002Fnode-chatgpt-api\u002Fcompare\u002Fv1.15.0...v1.15.3","2023-02-14T02:08:01"]