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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chatgpt-php

ChatGPT PHP SDK | Package

Total Downloads Latest Stable Version License

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 @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

  1. Create account on OpenAI's ChatGPT
  2. 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


All versions of chatgpt-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.2
ramsey/uuid Version ^4.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package haozi-team/chatgpt-php contains the following files

Loading the files please wait ....