openai-php/laravel
65.0
Adequate · 19 September 2026
380
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is a Laravel package that integrates the OpenAI API, providing a facade to access various AI endpoints such as Chat, Assistants, and Responses. It includes a CLI command for configuration, supports custom API settings like base URLs and timeouts, and offers a testing fake for mocking interactions. The package also features styled terminal output components for improved command-line user experience.
Features
Add CLI view rendering components
Introduced a new \View\ helper class in \src/Support\ that enables rendering PHP-based terminal views using the Termwind library, along with supporting Blade-like components (\badge\, \new-line\, \two-column-detail\) in \resources/views/components\. This allows the application to display formatted, styled output in the command-line interface, such as informational badges and two-column details, enhancing the user experience for CLI interactions.
resources, src/Support · high confidence
Expanded API resource coverage and added testing fake support
The OpenAI facade now exposes additional API resources including Assistants, Audio, Batches, Chat, Containers, Conversations, FineTuning, Realtime, Responses, Threads, and VectorStores, allowing users to interact with these specific endpoints via the facade. Additionally, a new \fake()\ method has been added to the facade, enabling developers to easily mock OpenAI responses during testing by swapping the underlying implementation with a fake instance.
src/Facades · high confidence
New install command and deferred service provider with advanced client configuration
Users can now run the \openai:install\ Artisan command to automatically publish the configuration file and add required environment variables (\OPENAI\_API\_KEY\, \OPENAI\_ORGANIZATION\) to their \.env\ files. The service provider has been made deferred to improve performance, and the OpenAI client registration now supports additional configuration options including \project\, \base\_uri\, and \request\_timeout\ from the config file, allowing for more flexible API integration.
src · high confidence
Behavioural changes
Configurable OpenAI API project, base URL, and request timeout
The OpenAI configuration now supports setting a specific API project via the OPENAI\_PROJECT environment variable, allowing legacy user API keys to be associated with a project. Users can also override the default API endpoint by specifying a custom base URL through OPENAI\_BASE\_URL, and control the maximum wait time for API responses by setting OPENAI\_REQUEST\_TIMEOUT (defaulting to 30 seconds).
config · high confidence
Corrected namespace and error message for ApiKeyIsMissing exception
The ApiKeyIsMissing exception class has been moved to the correct namespace (OpenAI\\Laravel\\Exceptions) to fix a previous namespace error. Additionally, the error message displayed when the API key is missing has been updated to capitalize 'Key' for consistency.
src/Exceptions · high confidence
Update to v0.21.0 with new install command and Responses API support
This release upgrades the underlying openai/client package to version 0.21.0. For users, the most visible change is the replacement of the manual vendor publish step with a new \php artisan openai:install\ command that automatically generates the configuration file and appends environment variable stubs to \.env\. The documentation and examples have been migrated to the new Responses API (using \OpenAI::responses()\ and models like \gpt-5\), replacing the legacy Completions API examples. Additionally, the README now explicitly requires PHP 8.2+, clarifies support for OpenAI Projects and Base URLs, and includes updated testing documentation for the \fake()\ facade.
(repo-wide) · high confidence
Test coverage
Added OpenAI testing fake class; Added architectural and service provider tests; Added tests for OpenAI facade mocking and assertion capabilities.
Dependencies
Major dependency upgrades and Laravel 13 support
This release upgrades core dependencies, requiring PHP 8.2+ and updating the OpenAI client to version 0.21.0. Laravel framework support is expanded to include versions 11.29, 12.12, and 13.0, while dev dependencies like Pest, PHPStan, and Laravel Pint are also bumped to their latest major versions. Additionally, auto-discovery is enabled for the OpenAI service provider.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 65.
Lenses
- Code Health 100
- Architecture 69
- Maturity 50
- Readiness 80
- Security 96
Changes since last survey
- 167 commits — 154 feature/other, 13 fixes
By area
- (root) — 102 commits
- .github/workflows — 26 commits
- (repo) — 14 commits
- src/ServiceProvider.php — 6 commits
- src/Facades — 4 commits
- tests/ServiceProvider.php — 3 commits
- config/openai.php — 2 commits
- src/Exceptions — 2 commits
- tests/Facades — 2 commits
- .github/FUNDING.yml — 1 commit
- .github/PULL_REQUEST_TEMPLATE.md — 1 commit
- .github/SECURITY.md — 1 commit
- .github/dependabot.yml — 1 commit
- resources/views — 1 commit
- tests/Arch.php — 1 commit
Notable commits
- fix: Fix Readme GitHub Badge Icon
- fix: Fix tests for Laravel 12
- fix: Readme: Fix model used in example (#67)
- fix: fix version constraint
- fix: fix(OpenAI): Remove assistants beta header (#175)
- fix: fix: add fineTuning method to OpenAI facade (#125)
- fix: fix: auto-discovery
- fix: fix: missing alias
- fix: fix: remove accidentally added dependency
- fix: fix: update to latest github action versions
- fix: fix: wrong namespace on exceptions
- fix: fixes failing arch test suite
- fix: tests: fixes facade test
- change: replace "text-davinci-003" by "gpt-3.5-turbo-instruct" in all examples (#65)
- change: Add 0.10.x hint to README
- change: Add batches API to facade
- change: Add install command
- change: Add testing ability (#27)
- change: Added audio to facade DocBlock
- change: Added chat to facade DocBlock
- …and 147 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
openai-php/laravel was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2879cfa4cac3a3912a14a25c31b23027699929ff — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.