Download the PHP package haozi-team/chatgpt-php without Composer
On this page you can find all versions of the php package haozi-team/chatgpt-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download haozi-team/chatgpt-php
More information about haozi-team/chatgpt-php
Files in haozi-team/chatgpt-php
Package chatgpt-php
Short Description Real ChatGPT PHP SDK (Not GPT-3)
License MIT
Homepage https://github.com/HaoZi-Team/ChatGPT-PHP
Informations about the package chatgpt-php
ChatGPT PHP SDK | Package
Official and Reverse Engineered ChatGPT API for PHP.
Reconstruct from @acheong08's ChatGPT
Installation
composer require haozi-team/chatgpt-php
V1 Web ChatGPT
Uses
chat.openai.com
- Free
- Rate limited
- Needs Bypassing Cloudflare
Default api endpoint is
https://ai.fakeopen.com/api/
by @pengzhileOpenAI rate limit: 50 requests per hour on free accounts. You can get around it with multi-account cycling
Plus accounts has around 150 requests per hour rate limit
Arkose Token: Recently, OpenAI began to require Arkose Token while bypassing Cloudflare request conversation API, usually the SDK can get it automatically through @pengzhile's API
Configuration
- Create account on OpenAI's ChatGPT
- Save your email and password
Authentication
- Access token
Login OpenAI account and go to https://chat.openai.com/api/auth/session to get your access_token.
The access_token is valid for 30 days.
Developer API
Basic example
Advanced example
You can pass "baseUrl" to the first parameter to set a custom API endpoint.
More refer to the wiki for advanced developer usage.
V2 Official ChatGPT
Recently released by OpenAI
- Costs money
Get API key from https://platform.openai.com/account/api-keys
Developer API
Basic example
Advanced example
You can pass "baseUrl" to the second parameter to set a custom API endpoint.
You can use addMessage
to add messages to the conversation.
You can set the stream
parameter to true
to get a stream for output answers as they are generated.
Disclaimers
This is not an official OpenAI product. This is a personal project and is not affiliated with OpenAI in any way. Don't sue me.
Credits
- acheong08 - Python ChatGPT API