Unoffical ChatGPT Api
Based on reverse engineering work done by the python community and quickly ported to nodejs for a project 😉
CAN USE EMAIL/PASSWORD TO GET SESSION TOKEN AUTOMAGICALLY 🚀
Install
npm install better-chatgpt
Features
Usage
Login via email and password
import { ChatGPT } from 'better-chatgpt';
const chat = new ChatGPT();
await chat.login('some@email.com', 'mypassword');
let response = await chat.getNextResponse('Hello, how are you?');
console.log(response);
response = await chat.getNextResponse('');
Use existing session/auth token
import { ChatGPT } from 'better-chatgpt';
const chat = new ChatGPT({
Authorization: '<token>',
sessionToken: '<token>'.
});
revert last response
chat.rollback()
WIP - More info to be added
TODO
Credits
Author: jcbdev
Source Code: https://github.com/jcbdev/better-chatgpt
License: MIT license