From your project root:
npm install @kudoai/chatgpt.js<script src="https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@4/dist/chatgpt.min.js"></script>Note To use a starter template: KudoAI/chatgpt.js-greasemonkey-starter
// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@4/dist/chatgpt.min.js
// ==/UserScript==Note To use a starter template: KudoAI/chatgpt.js-chrome-starter
-
Save https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@4/dist/chatgpt.min.js to
lib -
In project's (V3)
manifest.json, addlib/chatgpt.min.jsas a web accessible resource
"web_accessible_resources": [{
"matches": ["<all_urls>"],
"resources": ["lib/chatgpt.min.js"]
}],npm install -g @kudoai/chatgpt.jsSupported providers:
OpenRouter — 300+ models, dozens free
1. Create API key: https://openrouter.ai/settings/keys
2. Add key to environment:
setx OPENROUTER_API_KEY "sk-or-v1-8a69..."export OPENROUTER_API_KEY="sk-or-v1-8a69..."
Google AI — Gemini + Gemma models
1. Create API key: https://aistudio.google.com/api-keys
2. Add key to environment:
setx GOOGLE_API_KEY "AIzaSyB..."export GOOGLE_API_KEY="AIzaSyB..."import chatgpt from '@kudoai/chatgpt.js'
console.log(await chatgpt.send('sup'))
// e.g. => Hey! Not much—just here and ready to help. What's up with you?(async () => {
const chatgpt = require('@kudoai/chatgpt.js')
console.log(await chatgpt.send('sup'))
// e.g. => Hey! What's up?
})()(async () => {
await import(chrome.runtime.getURL('lib/chatgpt.min.js'))
await chatgpt.isLoaded()
console.log('ChatGPT is ready!')
})()chatgpt --query "sup" # or cjs -q sup
# e.g. => Hey there! What's up?For more options & examples, see the extended userguide:
https://github.com/KudoAI/chatgpt.js/blob/v4.0.2/docs/USERGUIDE.md
Create a new discussion: https://github.com/KudoAI/chatgpt.js/discussions/new?category=ideas
Keeps ChatGPT sessions fresh, eliminating chat time limits + network errors + Cloudflare checks.
Auto-play ChatGPT responses.
Use ChatGPT in Thunderbird to enhance you emails, even with a free account!
Install / Readme / Support
All contributions are very welcome!
Copyright © 2023–2026 KudoAI & contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.















![[Rated 5-stars]](https://assets.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?v=e638eac)
