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

ActiveLibrary[API Development](/categories/api)

itsimiro/laravel-openai
=======================

A laravel package to integrate openai in laravel application

v1.0.5(2y ago)5593MITPHPPHP ^8.1

Since Mar 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/miroslaws8/laravel-openai)[ Packagist](https://packagist.org/packages/itsimiro/laravel-openai)[ Docs](https://github.com/itsimiro/laravel-openai)[ RSS](/packages/itsimiro-laravel-openai/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

Laravel OpenAI
==============

[](#laravel-openai)

A laravel package to integrate openai in laravel application.

 [![GitHub Workflow Status (master)](https://github.com/miroslaws8/laravel-openai/actions/workflows/test.yml/badge.svg)](https://github.com/miroslaws8/laravel-openai/actions) [![Packagist Downloads](https://camo.githubusercontent.com/4dac7e1dc7fbcff7e0c2411d58f1c23648d4ac5585f5da6a1e49fa153b973f23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f697473696d69726f2f6c61726176656c2d6f70656e6169)](https://camo.githubusercontent.com/4dac7e1dc7fbcff7e0c2411d58f1c23648d4ac5585f5da6a1e49fa153b973f23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f697473696d69726f2f6c61726176656c2d6f70656e6169) [![Latest Version](https://camo.githubusercontent.com/16708f5a4c5b68b708e53176a394adff13432ecfe31524a03b0295bcc65b563a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f697473696d69726f2f6c61726176656c2d6f70656e6169)](https://packagist.org/packages/itsimiro/laravel-openai)

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

[](#installation)

You can install the package via composer:

```
composer require itsimiro/laravel-openai
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Itsimiro\OpenAI\Providers\OpenaiServiceProvider"

```

This will create a config/laravel-openai.php configuration file in your project. Be sure to specify the key in your environment file.

```
OPENAI_API_KEY=sk-*

```

Endpoint Support
----------------

[](#endpoint-support)

#### Available now:

[](#available-now)

- Completions
    - [Create completion](https://platform.openai.com/docs/api-reference/completions/create)
- Chat
    - [Create chat completion](https://platform.openai.com/docs/api-reference/chat/create)
- Edits
    - [Create edit](https://platform.openai.com/docs/api-reference/edits/create)
- Models
    - [List models](https://platform.openai.com/docs/api-reference/models/list)
    - [Retrieve model](https://platform.openai.com/docs/api-reference/models/retrieve)
- Images
    - [Create image](https://platform.openai.com/docs/api-reference/images/create)

#### Coming soon:

[](#coming-soon)

- Images
    - Create image edit
- Audio
    - Create transcription
    - Create translation
- Embeddings
    - Create embeddings

Usage
-----

[](#usage)

#### Create completion:

[](#create-completion)

```
$openAI = $this->container->make(\Itsimiro\OpenAI\Services\OpenAI::class);

$result = $openAI->getDavinci()->completion(new \Itsimiro\OpenAI\Services\DataTransferObjects\CompletionParameters()); // Itsimiro\OpenAI\Services\API\Results\CompletionResult

$result->getChoices(); // Choices from OpenAI.
```

#### Create chat:

[](#create-chat)

```
$openAI = $this->container->make(\Itsimiro\OpenAI\Services\OpenAI::class);

$result = $openAI->getDavinci()->chat(new ChatParameters()); // Itsimiro\OpenAI\Services\API\Results\CompletionResult

$result->getChoices(); // Choices from OpenAI.
```

#### Create image:

[](#create-image)

```
$openAI = $this->container->make(\Itsimiro\OpenAI\Services\OpenAI::class);

$result = $openAI->getDalle()->createImage(new CreateImageParameters(
  'dog with a bone',
  2,
  responseFormat: ImageResponseFormatEnum::URL
 ));

$result->getImages(); // Generated images
```

#### See the [documentation](https://platform.openai.com/docs/api-reference) for more details on using OpenAI.

[](#see-the-documentation-for-more-details-on-using-openai)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~50 days

Recently: every ~62 days

Total

6

Last Release

970d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151869885?v=4)[itsimiro](/maintainers/itsimiro)[@itsimiro](https://github.com/itsimiro)

---

Top Contributors

[![miroslaws8](https://avatars.githubusercontent.com/u/78157941?v=4)](https://github.com/miroslaws8 "miroslaws8 (3 commits)")[![servis](https://avatars.githubusercontent.com/u/3391351?v=4)](https://github.com/servis "servis (1 commits)")

---

Tags

laravellaravel-openaiopen-aiopenaiopenai-apilaravelopenaiOpen AIlaravel-openaiitsimiro

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M993](/packages/statamic-cms)[openai-php/laravel

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

3.7k9.5M89](/packages/openai-php-laravel)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[moe-mizrak/laravel-openrouter

Laravel package for OpenRouter (A unified interface for LLMs)

154177.9k2](/packages/moe-mizrak-laravel-openrouter)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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