PHPackages                             llm-agents/openai-client - 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. llm-agents/openai-client

ActiveLibrary[API Development](/categories/api)

llm-agents/openai-client
========================

OpenAI API client for LLM Agents

1.5.0(1y ago)42982[1 issues](https://github.com/llm-agents-php/openai-client/issues)1MITPHPPHP ^8.3

Since Aug 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/llm-agents-php/openai-client)[ Packagist](https://packagist.org/packages/llm-agents/openai-client)[ RSS](/packages/llm-agents-openai-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (6)Versions (11)Used By (1)

LLM Agents OpenAI Client
========================

[](#llm-agents-openai-client)

[![PHP](https://camo.githubusercontent.com/6e8241363511e3b6f910f04f38f8e630230f0330b780af1a01cbd095f6b36596/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c6c6d2d6167656e74732f6f70656e61692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/openai-client)[![Latest Version on Packagist](https://camo.githubusercontent.com/84c0a10643ea4ac718c3a2ec2764a717bb350dd2f1e8a61c2f9ab40b5e677aa0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6c6d2d6167656e74732f6f70656e61692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/openai-client)[![Total Downloads](https://camo.githubusercontent.com/c98d72fe0347231c4a2b87d98ebf973ee6669d1861f5d1b992553b1043851b69/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6c6d2d6167656e74732f6f70656e61692d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/llm-agents/openai-client)

This package is your go-to solution for integrating OpenAI's powerful API into your LLM Agents projects.

What's in the box?
------------------

[](#whats-in-the-box)

- Easy setup with Spiral framework
- Smooth integration with OpenAI's API
- Built to work hand-in-hand with LLM Agents

Installation 🛠️
---------------

[](#installation-️)

1. Run this command to add the package to your project:

```
composer require llm-agents/openai-client
```

2. That's it! You're ready to roll.

### Setting it up in Spiral

[](#setting-it-up-in-spiral)

To get the OpenAI client up and running in your Spiral app, you need to register the bootloader.

**Here's how:**

1. Open up your `app/src/Application/Kernel.php` file.
2. In your `Kernel` class add the `LLM\Agents\OpenAI\Client\Integration\Spiral\OpenAIClientBootloader` bootloader:

```
class Kernel extends \Spiral\Framework\Kernel
{
   public function defineBootloaders(): array
   {
       return [
           // ... other bootloaders ...
           \LLM\Agents\OpenAI\Client\Integration\Spiral\OpenAIClientBootloader::class,
       ];
   }
}
```

The package uses your OpenAI API key and organization (if you have one) to authenticate.

Set these up in your `.env` file:

```
OPENAI_KEY=your_api_key_here

```

### Setting it up in Laravel

[](#setting-it-up-in-laravel)

If you're using the Laravel framework, you'll need to install the `openai-php/laravel` package register the Service provider.

**Here's how:**

1. Install the `openai-php/laravel` package:

```
composer require openai-php/laravel
```

2. Next, execute the install command:

```
php artisan openai:install
```

3. Finally, add your OpenAI API key to your `.env` file:

```
OPENAI_API_KEY=sk-...
OPENAI_ORGANIZATION=org-...

```

4. And register the `LLM\Agents\OpenAI\Client\Integration\Laravel\OpenAIClientServiceProvider`

And that's it! The service provider will take care of registering the `LLMInterface` for you.

Contributing
------------

[](#contributing)

We're always happy to get help making this package even better! Here's how you can chip in:

1. Fork the repo
2. Make your changes
3. Create a new Pull Request

Please make sure your code follows PSR-12 coding standards and include tests for any new features.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

That's all, folks! If you run into any issues or have questions, feel free to open an issue on GitHub.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance43

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~30 days

Recently: every ~58 days

Total

9

Last Release

385d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/773481?v=4)[Pavel Buchnev](/maintainers/butschster)[@butschster](https://github.com/butschster)

---

Top Contributors

[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (26 commits)")[![ilyachase](https://avatars.githubusercontent.com/u/1961077?v=4)](https://github.com/ilyachase "ilyachase (2 commits)")

---

Tags

clientllmllm-agentsllm-toolsopenaiphpphp8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/llm-agents-openai-client/health.svg)

```
[![Health](https://phpackages.com/badges/llm-agents-openai-client/health.svg)](https://phpackages.com/packages/llm-agents-openai-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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