PHPackages                             2k11cs12/openai-laravel - 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. 2k11cs12/openai-laravel

ActiveLibrary[API Development](/categories/api)

2k11cs12/openai-laravel
=======================

Streamline OpenAI integration in Laravel for text generation.

v1.0.1(2y ago)012[2 PRs](https://github.com/2K11CS12/openai-laravel/pulls)MITPHPPHP ^8.0

Since Sep 14Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/2K11CS12/openai-laravel)[ Packagist](https://packagist.org/packages/2k11cs12/openai-laravel)[ RSS](/packages/2k11cs12-openai-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

Laravel OpenAI Integration
==========================

[](#laravel-openai-integration)

[![GitHub](https://camo.githubusercontent.com/ebc439ebdf08cf082667dcf8155bcee6cc17faf295ba18bea4e7f6cbace27ba3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f324b3131435331322f6c61726176656c2d6f70656e6169)](https://camo.githubusercontent.com/ebc439ebdf08cf082667dcf8155bcee6cc17faf295ba18bea4e7f6cbace27ba3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f324b3131435331322f6c61726176656c2d6f70656e6169)[![GitHub release (latest by date)](https://camo.githubusercontent.com/c8d88ec6517092da15b40f6b61a129c319e3d3d2086024ff507572893eb261c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f324b3131435331322f6c61726176656c2d6f70656e6169)](https://camo.githubusercontent.com/c8d88ec6517092da15b40f6b61a129c319e3d3d2086024ff507572893eb261c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f324b3131435331322f6c61726176656c2d6f70656e6169)[![GitHub Workflow Status](https://camo.githubusercontent.com/38e3e5e662d1182fba82030f985decec25216556d70a7377717fa941c6b338f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f324b3131435331322f6c61726176656c2d6f70656e61692f4349)](https://camo.githubusercontent.com/38e3e5e662d1182fba82030f985decec25216556d70a7377717fa941c6b338f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f324b3131435331322f6c61726176656c2d6f70656e61692f4349)

**Laravel OpenAI Integration** simplifies the integration of OpenAI's powerful language models into your Laravel application. This package provides a convenient way to interact with OpenAI for natural language processing and text generation tasks.

Features
--------

[](#features)

- Easy configuration of OpenAI API credentials.
- Simplified methods for generating text using OpenAI models.
- Customizable options for text generation.
- Seamless integration with your Laravel project.

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

[](#installation)

You can install this package via Composer. Run the following command in your Laravel project:

```
composer require Mangrio/laravel-openai
```

Configuration
-------------

[](#configuration)

```
OPENAI_API_KEY=your-api-key-here
OPENAI_API=https://api.openai.com/v1/chat/completions
OPENAI_MODEL=gpt-3.5-turbo

```

Usage
-----

[](#usage)

```
// Import the OpenAI facade at the top of your file
use Mangrio\OpenAiLaravel\Facades\OpenAiLaravel;

$response = OpenAiLaravel::generate('Prompt')
    ->key('your-api-key')
    ->temperature(1.0)
    ->maxTokens(1000)
    ->topP(0.8)
    ->model('custom-model')
    ->frequencyPenalty(0.5)
    ->presencePenalty(0.3)
    ->execute();

```

Additional Options
------------------

[](#additional-options)

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

[](#contributing)

License
-------

[](#license)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance41

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~0 days

Total

2

Last Release

972d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5bcbeb51a3c99231a4ede07f1a0a3057f2b0f10272e27c7a61babc66c5f8bc4?d=identicon)[2k11cs12](/maintainers/2k11cs12)

---

Top Contributors

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

---

Tags

laravelaiopenaiintegrationChatGptgenerativemangrio

### Embed Badge

![Health badge](/badges/2k11cs12-openai-laravel/health.svg)

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

###  Alternatives

[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5010.8k](/packages/claude-php-claude-php-sdk-laravel)[vectorifyai/vectorify-laravel

Vectorify package for Laravel. The fastest way to ask AI about your data.

206.1k](/packages/vectorifyai-vectorify-laravel)[creativecrafts/laravel-ai-assistant

A handy package to access and interact with OpenAi endpoint

141.1k](/packages/creativecrafts-laravel-ai-assistant)

PHPackages © 2026

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