PHPackages                             idmaintzain/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. idmaintzain/openai

ActiveLibrary[API Development](/categories/api)

idmaintzain/openai
==================

A Laravel package for OpenAI integration

v1.0.0(2y ago)05MITPHPPHP ^7.3|^8.0

Since Feb 22Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel OpenAI Package
======================

[](#laravel-openai-package)

This Laravel package provides a simple and convenient way to interact with the OpenAI API, leveraging the power of AI models like GPT-3 directly from your Laravel applications.

Features
--------

[](#features)

- **Easy configuration:** Utilize Laravel's standard methods for seamless integration.
- **Facade:** Facade for straightforward usage of the OpenAI API.
- **Customizable:** Utilize any OpenAI model to fit your specific needs.

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

[](#installation)

### 1. Composer

[](#1-composer)

Add the package to your project:

```
composer require idmaintzain/openai
```

### 2. Publish Configuration (Optional)

[](#2-publish-configuration-optional)

(Optional) Publish the configuration for customization: php artisan vendor:publish --provider="Idmaintzain\\OpenAI\\OpenAIServiceProvider" --tag=config

```
php artisan vendor:publish --provider="Idmaintzain\OpenAI\OpenAIServiceProvider" --tag=config
```

### 3. Environment Configuration

[](#3-environment-configuration)

Add your OpenAI API key to your .env file:

```
OPENAI_API_KEY=your_openai_api_key_here
```

### Usage

[](#usage)

Access the OpenAI client via the facade or dependency injection:

Via Facade:

```
$response = OpenAI::complete('Your prompt here');
```

Via Dependency Injection:

```
public function generateText(\Idmaintzain\OpenAI\OpenAIClient $openAI)
{
    $response = $openAI->complete('Your prompt here');
    return $response;
}
```

### Example: Generating Text

[](#example-generating-text)

```
use Idmaintzain\OpenAI\Facades\OpenAI;

$response = OpenAI::complete('Translate the following English text to French: "Hello, how are you?"', [
    'model' => 'text-davinci-003', // Model specification
    'temperature' => 0.7,
    'max_tokens' => 100,
]);

print_r($response);
```

### Customization

[](#customization)

Customize settings in the config/openai.php file after publishing.

### Support

[](#support)

For issues, questions, or contributions, visit the project's GitHub repository

### License

[](#license)

This package is open-sourced under the MIT license.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

862d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ec54feb4e011af33e9391cb1e4240136496194c34094669ca9a4dd2c6f256a0?d=identicon)[idmaintzain](/maintainers/idmaintzain)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)

PHPackages © 2026

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