PHPackages                             haozi-team/chatgpt-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. haozi-team/chatgpt-php

Abandoned → [github.com/pandora-next/deploy](/?search=github.com%2Fpandora-next%2Fdeploy)ArchivedLibrary

haozi-team/chatgpt-php
======================

Real ChatGPT PHP SDK (Not GPT-3)

2.1.2(2y ago)1147.5k↑172.7%27[1 issues](https://github.com/tnborg/ChatGPT-PHP/issues)MITPHPPHP &gt;=7.4

Since Mar 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tnborg/ChatGPT-PHP)[ Packagist](https://packagist.org/packages/haozi-team/chatgpt-php)[ Docs](https://github.com/HaoZi-Team/ChatGPT-PHP)[ RSS](/packages/haozi-team-chatgpt-php/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (3)Versions (33)Used By (0)

ChatGPT PHP SDK | [Package](https://packagist.org/packages/haozi-team/chatgpt-php)
==================================================================================

[](#chatgpt-php-sdk--package)

[![Total Downloads](https://camo.githubusercontent.com/5a5fedd13e06c8649d86bbec48fc6f66215aef8458e13998f1e442073c07495e/68747470733a2f2f706f7365722e707567782e6f72672f48616f5a692d5465616d2f436861744750542d5048502f642f746f74616c2e737667)](https://packagist.org/packages/haozi-team/chatgpt-php)[![Latest Stable Version](https://camo.githubusercontent.com/dca979d11a34f0f2b786c8d02d922aae5f0a5358b43dc918aafe59394674d816/68747470733a2f2f706f7365722e707567782e6f72672f48616f5a692d5465616d2f436861744750542d5048502f762f737461626c652e737667)](https://packagist.org/packages/haozi-team/chatgpt-php)[![License](https://camo.githubusercontent.com/4794b850404632191978f70eab5775d30aa487a8938fff791709191cdad5c585/68747470733a2f2f706f7365722e707567782e6f72672f48616f5a692d5465616d2f436861744750542d5048502f6c6963656e73652e737667)](https://packagist.org/packages/haozi-team/chatgpt-php)

Official and Reverse Engineered ChatGPT API for PHP.

Reconstruct from @acheong08's [ChatGPT](https://github.com/acheong08/ChatGPT)

Installation
============

[](#installation)

`composer require haozi-team/chatgpt-php`

V1 Web ChatGPT
==============

[](#v1-web-chatgpt)

> Uses `chat.openai.com`
>
> - Free
> - Rate limited
> - Needs Bypassing Cloudflare

> Default api endpoint is `https://ai.fakeopen.com/api/` by @pengzhile
>
> OpenAI 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
-------------

[](#configuration)

1. Create account on [OpenAI's ChatGPT](https://chat.openai.com/)
2. Save your email and password

### Authentication

[](#authentication)

#### - Access token

[](#--access-token)

Login OpenAI account and go to to get your access\_token.

```
{
  "access_token": ""
}
```

The access\_token is valid for 30 days.

Developer API
-------------

[](#developer-api)

### Basic example

[](#basic-example)

```
