PHPackages                             phpexperts/chatgpt-speaker - 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. phpexperts/chatgpt-speaker

ActiveLibrary

phpexperts/chatgpt-speaker
==========================

A quick and easy extension for effortlessly handling OpenAI's API for ChatGPT.

381[8 issues](https://github.com/PHPExpertsInc/ChatGPTSpeaker/issues)[1 PRs](https://github.com/PHPExpertsInc/ChatGPTSpeaker/pulls)PHP

Since Feb 27Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/PHPExpertsInc/ChatGPTSpeaker)[ Packagist](https://packagist.org/packages/phpexperts/chatgpt-speaker)[ RSS](/packages/phpexperts-chatgpt-speaker/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ChatGPTSpeaker
==============

[](#chatgptspeaker)

[![Maintainability](https://camo.githubusercontent.com/8da10a23814e48261342fb858d64d903cf4834de25797a861325ec59201cfee0/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f62613035623565626661366262323131363139652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/phpexpertsinc/RESTSpeaker/maintainability)[![Test Coverage](https://camo.githubusercontent.com/01318f7af7e9d2d65960fdf5bef48477b6acb61ca49dba5346d2a6974c9dbac2/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f62613035623565626661366262323131363139652f746573745f636f766572616765)](https://codeclimate.com/github/phpexpertsinc/RESTSpeaker/test_coverage)

ChatGPTSpeaker is a PHP Experts, Inc., Project meant to ease the accessing of the OpenAI APIs.

This library uses [RESTSpeaker](https://packagist.org/package/phpexperts/rest-speaker)to utilize the Guzzle HTTP Client via the Composition architectural pattern.

You might be very interested in the projects that used by and/or adjacent to this project:

- **PHP Evolver**
    - `composer require phpexperts/evolver`
    - One of only two Genetic Algorithm (GA) libraries for PHP, but very easy to use.
    - One of the few AI / Machine Learning libraries for PHP.
    -
- **RESTSpeaker**
    - `composer require phpexperts/rest-speaker`
    - A very easy way to consume REST APIs. Built on top of Guzzle but with a much better interface.
    -
- **SimpleDTO**
    - `composer require phpexperts/simple-dto`
    - Easily build validating DTOs for PHP 7.2+.
    -

Installation
------------

[](#installation)

Via Composer

```
composer require phpexperts/chatgpt-speaker
```

Copy `.env.example` to `.env` in your project's root directory and put in your OpenAI credentials.

Change log
----------

[](#change-log)

Please see the [changelog](CHANGELOG.md) for more information on what has changed recently.

Usage
-----

[](#usage)

By default, JSON results are returned.

```
    $chatGPT = new ChatGPTSpeaker();

    $prompt = returnText();

    $prompt = http->testHandler->getRecords()[0];

Output:
curl 'https://api.openai.com/v1/chat/completions' -A 'PHPExperts/RESTSpeaker-2.4 (PHP 8.3.3)' \
   -H 'Content-Type: application/json'  -H 'Authorization: Bearer [redacted]' \
   -X POST  -d '{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"Say 'Hello, World!'."}]}'
```

(From RESTSpeaker) To get the raw payload as returned by api.openai.com:

```
$rawReturn = (string)$chatGPT->api->getLastResponse()->getBody();
```

Use cases
=========

[](#use-cases)

✔ Returns the same responses as chat.openai.com.

Testing
-------

[](#testing)

```
phpunit
```

Roadmap
=======

[](#roadmap)

- Implement the Models endpoint
- Implement the Images endpoints
- Implement the Files endpoint
- Implement the Audio endpoints
- Implement the new Embeddings endpoints for AI Model Training
- Implement the new Fine Tunings Endpoints for custom GPT Agents
- Implement the Moderations endpoint
- Implement support for the GPT5 Agents

Contributors
============

[](#contributors)

[Theodore R. Smith](https://www.phpexperts.pro/%5D)
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License
-------

[](#license)

**CC-BY-ND-4.0**Creative Commons NoDerivations v4.0: Please see the [license file](LICENSE) for more information.

**YOU MAY FORK THIS PROJECT.**

**YOU MAY NOT PUBLISH ANY DERIVATION of this project to either your own website or a third-party host.**

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a2dd16766f6b03c330e65aaca9dfb97f1bbbb41c5e2af5681f58f670b7917?d=identicon)[hopeseekr](/maintainers/hopeseekr)

---

Top Contributors

[![hopeseekr](https://avatars.githubusercontent.com/u/1125541?v=4)](https://github.com/hopeseekr "hopeseekr (5 commits)")

### Embed Badge

![Health badge](/badges/phpexperts-chatgpt-speaker/health.svg)

```
[![Health](https://phpackages.com/badges/phpexperts-chatgpt-speaker/health.svg)](https://phpackages.com/packages/phpexperts-chatgpt-speaker)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
