🤖 A powerful, lightweight JavaScript library + interactive CLI for ChatGPT
See the code[!IMPORTANT]
This project has moved to https://gitlab.com/kudoai/chatgpt-js
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, add lib/chatgpt.min.js as a web accessible resource
"web_accessible_resources": [{
"matches": ["<all_urls>"],
"resources": ["lib/chatgpt.min.js"]
}],
npm install -g @kudoai/chatgpt.js
Supported providers:
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..."
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!')
})()
After setting an API key, control from your terminal:
chatgpt --query "sup" # or gpt -q sup
# e.g. => Hey there! What's up?
chatgpt --ascii-art "cat" # or gpt -a cat
# e.g. =>
#
# |\ _,,,---,,_
# ZZZzz /,`.-'`' -. ;-;;,_
# |,4- ) )-,_. ,\ ( `'-'
# '---''(_/--' `-'\_)
chatgpt --commit-msg # or gpt -g (in a git repo)
# e.g. => feat: add `--ascii-art` cli cmd
(Optional) Create .chatgpt.config.mjs (customize provider, etc.):
chatgpt init # or gpt -i
View all CLI options:
chatgpt --help
For more options & examples, see the extended user guide:
https://github.com/KudoAI/chatgpt.js/blob/v4.15.6/docs/USERGUIDE.md



Create a new Issue: https://github.com/KudoAI/chatgpt.js/issues/new

Keeps ChatGPT sessions fresh, eliminating chat time limits + network errors + Cloudflare checks.

Auto-play ChatGPT responses.

![[Rated 5-stars]](https://assets.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?v=e638eac)
Use ChatGPT in Thunderbird to enhance your emails, even with a free account!
Install / README / Support
All contributions are 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.
1,111 followers · starred Jul 2023
1,131 followers · starred Apr 2024
1,329 followers · starred Oct 2024
215 followers · starred Sep 2023
🤖 A powerful, lightweight JavaScript library + interactive CLI for ChatGPT
See the code[!IMPORTANT]
This project has moved to https://gitlab.com/kudoai/chatgpt-js
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, add lib/chatgpt.min.js as a web accessible resource
"web_accessible_resources": [{
"matches": ["<all_urls>"],
"resources": ["lib/chatgpt.min.js"]
}],
npm install -g @kudoai/chatgpt.js
Supported providers:
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..."
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!')
})()
After setting an API key, control from your terminal:
chatgpt --query "sup" # or gpt -q sup
# e.g. => Hey there! What's up?
chatgpt --ascii-art "cat" # or gpt -a cat
# e.g. =>
#
# |\ _,,,---,,_
# ZZZzz /,`.-'`' -. ;-;;,_
# |,4- ) )-,_. ,\ ( `'-'
# '---''(_/--' `-'\_)
chatgpt --commit-msg # or gpt -g (in a git repo)
# e.g. => feat: add `--ascii-art` cli cmd
(Optional) Create .chatgpt.config.mjs (customize provider, etc.):
chatgpt init # or gpt -i
View all CLI options:
chatgpt --help
For more options & examples, see the extended user guide:
https://github.com/KudoAI/chatgpt.js/blob/v4.15.6/docs/USERGUIDE.md



Create a new Issue: https://github.com/KudoAI/chatgpt.js/issues/new

Keeps ChatGPT sessions fresh, eliminating chat time limits + network errors + Cloudflare checks.

Auto-play ChatGPT responses.

![[Rated 5-stars]](https://assets.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?v=e638eac)
Use ChatGPT in Thunderbird to enhance your emails, even with a free account!
Install / README / Support
All contributions are 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.
1,111 followers · starred Jul 2023
1,131 followers · starred Apr 2024
1,329 followers · starred Oct 2024
215 followers · starred Sep 2023