PHPackages                             filippo-toso/openai - 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. [API Development](/categories/api)
4. /
5. filippo-toso/openai

ActiveLibrary[API Development](/categories/api)

filippo-toso/openai
===================

An unofficial OpenAI SDK

v1.0.2(2y ago)0108MITPHPPHP ^8.0 || ^9.0

Since Mar 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/filippotoso/openai)[ Packagist](https://packagist.org/packages/filippo-toso/openai)[ RSS](/packages/filippo-toso-openai/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (4)Used By (0)

OpenAI unofficial PHP SDK
=========================

[](#openai-unofficial-php-sdk)

A simple SDK to use OpenAI APIs

Requirements
------------

[](#requirements)

- PHP 8.0+

Installing
----------

[](#installing)

Use Composer to install it:

```
composer require filippo-toso/openai

```

If you don't already have an implementation for psr/http-factory and psr/http-client, you should execute also:

```
composer require php-http/curl-client laminas/laminas-diactoros

```

Vanilla PHP usage
-----------------

[](#vanilla-php-usage)

Create the SDK instance and call the various endpoints.

```
use FilippoToso\OpenAI\OpenAI;
use FilippoToso\OpenAI\Options;

require(__DIR__ . '/../vendor/autoload.php');

$options = new Options([
    'apiKey' => 'your-api-key', // @see https://platform.openai.com/account/api-keys
    'oprganizationId' => 'your-organization-id', // @see https://platform.openai.com/account/org-settings
]);

$openAi = new OpenAI($options);

$response = $openAi->models()->list();

print_r($response->body());
```

Laravel usage
-------------

[](#laravel-usage)

In your config/services.php files add:

```
return [

    // ...

    'openai' => [
        'api_key' => env('OPENAI_API_KEY'),
        'organization_id' => env('OPENAI_ORGANIZATION_ID'),
    ],
];
```

In your .env file, add the following variables:

```
OPENAI_API_KEY=your-api-key
OPENAI_ORGANIZATION_ID=your-organization-id

```

In your Laravel code:

```
use FilippoToso\OpenAI\Laravel\OpenAI;

$response = OpenAI::models()->list();

dump($response->body());
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~73 days

Total

3

Last Release

1073d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d89f2d44fb12225de2119994028ee69e36770bcf33c2b1ddf0d6672d28151b?d=identicon)[filippo.toso](/maintainers/filippo.toso)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/filippo-toso-openai/health.svg)

```
[![Health](https://phpackages.com/badges/filippo-toso-openai/health.svg)](https://phpackages.com/packages/filippo-toso-openai)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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