Unofficial API in Dart
FreeDart client for the unofficial ChatGPT API
FreeFree tier
About Unofficial API in Dart
Dart client for the unofficial ChatGPT API, ported from the popular Node.js version. It provides a Dart wrapper around OpenAI's ChatGPT, allowing developers to build projects like chatbots and websites powered by ChatGPT. The API requires a valid session token from the ChatGPT web interface to access the unofficial REST API. This package is open source under the MIT license and is in early development, requiring further testing and improvements.
Key Features
Dart wrapper around OpenAI's ChatGPT
Uses unofficial REST API
Requires ChatGPT session token for authentication
Ported from transitive-bullshit/chatgpt-api (Node.js)
Enables building chatbots and websites powered by ChatGPT
Open source under MIT license
Includes example and test files
Pros & Cons
Pros
- Free and open source
- Simple authentication using session token
- Ported from a well-known Node.js implementation
- Provides example and test code for quick start
- Enables programmatic access to ChatGPT in Dart
Cons
- Unofficial API subject to change or break
- Requires manual session token retrieval from browser cookies
- Early stage: may be unstable and needs testing
- Limited documentation beyond README
Best For
Building chatbots using ChatGPTCreating websites powered by ChatGPTIntegrating ChatGPT into Dart applicationsPrototyping ChatGPT-based projects in Dart
FAQ
How do I get a session token?
Go to https://chat.openai.com/chat, log in or sign up, open developer tools, go to Application > Cookies, copy the value for '__Secure-next-auth.session-token', and save it to your environment.
Is this the official OpenAI API?
No, this is a Dart wrapper around the unofficial REST API of ChatGPT. It requires a valid session token from the ChatGPT web interface.
What can I build with this package?
You can build chatbots, websites, and other Dart applications that interact with ChatGPT.