Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MisterJimson/chatgpt_api_dart
Dart client for the unofficial ChatGPT API
https://github.com/MisterJimson/chatgpt_api_dart
Last synced: 3 months ago
JSON representation
Dart client for the unofficial ChatGPT API
- Host: GitHub
- URL: https://github.com/MisterJimson/chatgpt_api_dart
- Owner: MisterJimson
- License: mit
- Created: 2022-12-05T16:06:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T18:23:38.000Z (about 2 years ago)
- Last Synced: 2024-07-31T23:39:48.139Z (5 months ago)
- Language: C++
- Size: 295 KB
- Stars: 56
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gpt - chatgpt_api_dart - Dart client for the unofficial ChatGPT API (Applications / APIs & Clients)
- awesome-chatgpt-summary - Unofficial API in Dart
- Awesome-ChatGPT - Unofficial API in Dart
- awesome-chatgpt-tools - Unofficial API in Dart
- awesome-chatgpt - Unofficial API in Dart
- awesome-chatgpt - ChatGPT API Dart
- fucking-awesome-chatgpt - Unofficial API in Dart
- awesome-chatgpt - Unofficial API in Dart
- awesome-chatgpt - Wrapper
- awesome-chatgpt - ChatGPT API Dart
- awesome-gpt - Unofficial API in Dart
- awesome-chatgpt-zh - Dart 中的非官方 API
- awesome-ChatGPT-resource-zh - 【非官方】【Dart】 MisterJimson/chatgpt_api_dart
README
# ChatGPT API Dart
Dart client for the unofficial ChatGPT APIPorted from https://github.com/transitive-bullshit/chatgpt-api
## Intro
This package is a Dart wrapper around [ChatGPT](https://openai.com/blog/chatgpt) by [OpenAI](https://openai.com).
You can use it to start building projects powered by ChatGPT like chatbots, websites, etc...
## Demo
https://user-images.githubusercontent.com/7351329/205991375-d0125d59-6fa4-456d-b4fa-a23c94dc1841.mp4
## How it works
This package requires a valid session token from ChatGPT to access it's unofficial REST API.
To get a session token:
1. Go to https://chat.openai.com/chat and log in or sign up.
2. Open dev tools.
3. Open `Application` > `Cookies`
4. Copy the value for `__Secure-next-auth.session-token` and save it to your environment.When you create the `GptChatApi` client, pass it this token.
## Status
This project was a very quick port of the node version, it requires testing and changes to make it more robust and useable.## Development
Create these files and add your session token to run the tests and example respectively:
- `test/session_token.dart`
- `example/lib/session_token.dart`Should look something like this:
```dart
const SESSION_TOKEN = 'my session token from https://chat.openai.com/chat';
```