# better-chatgpt

> A better chatgpt unnofficial api

Latest version **1.0.3** (published 2022-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install better-chatgpt
pnpm add better-chatgpt
yarn add better-chatgpt
bun add better-chatgpt
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-12-10 |
| First published | 2022-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 31.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | James Barker |
| Maintainers | jcbdev |
| Keywords | chatgpt, gpt, gpt api, chatgpt api |

## Links

- npm: https://www.npmjs.com/package/better-chatgpt
- Repository: https://github.com/jcbdev/better-chatgpt
- Homepage: https://github.com/jcbdev/better-chatgpt#readme
- Issues: https://github.com/jcbdev/better-chatgpt/issues
- npm.io page: https://npm.io/package/better-chatgpt

## Recent versions

- 1.0.3 (latest) — 2022-12-10
- 1.0.2 — 2022-12-10
- 1.0.1 — 2022-12-10
- 1.0.0 — 2022-12-10

## README

# better-chatgpt

Unoffical ChatGPT Api

Based on reverse engineering work done by the python community and quickly ported to nodejs for a project 😉

# Install

```
npm install better-chatgpt
```

# Functionality

- No moderation
- Programmable.
- Resume conversation
- Rewind/undo
- Email/password authentication
- Cookie based authentication
- Access Token authentication

# 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

- Examples
- Documentation
- Proxies
- Logging
- Improve test conerage

# Credits

- [acheong08](https://github.com/acheong08/ChatGPT) - Original python implementation that inspired this
- [rawandahmad698](https://github.com/rawandahmad698) - Reverse engineering Auth0
- [FlorianREGAZ](https://github.com/FlorianREGAZ) - TLS client
- [PyRo1121](https://github.com/PyRo1121) - Linting
- [Harry-Jing](https://github.com/Harry-Jing) - Async support
- [Ukenn2112](https://github.com/Ukenn2112) - Documentation
- [All other contributors](https://github.com/acheong08/ChatGPT/graphs/contributors)

---
_Source: https://npm.io/package/better-chatgpt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
