Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Laravel Package

openai-php/laravel

Community-maintained OpenAI PHP integration for Laravel. Install via Composer and artisan, configure API key in .env, then use the OpenAI facade to call OpenAI endpoints (e.g., Responses API) from your Laravel app.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI/ML Integration Roadmap: Accelerates adoption of OpenAI APIs (e.g., GPT-5, fine-tuning, real-time interactions) for Laravel-based products like chatbots, content generation, or data analysis tools.
  • Build vs. Buy: Buy—avoids reinventing OpenAI API wrappers, reducing dev time by 60%+ for authentication, rate limiting, and response handling.
  • Use Cases:
    • Customer Support: Dynamic chatbots with conversations facade.
    • Content Platforms: Auto-generated summaries/translations via responses facade.
    • Internal Tools: Fine-tuning models for domain-specific tasks (e.g., legal/medical documentation).
    • Testing: Mock API responses with fake() to avoid hitting rate limits during QA.
  • Tech Stack Alignment: Ideal for Laravel ecosystems (v10–13) already using PHP 8.2+ and Composer.

When to Consider This Package

  • Adopt if:

    • Your product relies on OpenAI’s API for core functionality (e.g., generative AI, embeddings).
    • You’re using Laravel and want seamless integration with facades (e.g., OpenAI::responses()->create()).
    • You need testing support (mock responses, request assertions) to reduce API costs.
    • Your team lacks bandwidth to build/maintain a custom OpenAI client.
  • Look Elsewhere if:

    • You’re not using Laravel (use the framework-agnostic openai-php/client instead).
    • You require advanced customization (e.g., non-standard API endpoints, WebSocket support beyond realtime).
    • Your project uses PHP <8.2 or Laravel <10 (though v11+ is restored in v0.13.0).
    • You need multi-cloud AI providers (e.g., Azure OpenAI) without vendor lock-in.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us integrate OpenAI’s cutting-edge models (like GPT-5) into our Laravel apps without building a custom API client—saving 3–6 months of dev time. It’s battle-tested (3.7K stars), MIT-licensed, and includes built-in testing tools to cut API costs during development. For example, we could launch an AI-powered support chatbot in Q3 by leveraging its conversations facade, while the fake() method lets QA test responses locally. The underlying openai-php/client is actively maintained, so we avoid vendor risk."

For Engineering:

*"This is a drop-in Laravel wrapper for OpenAI’s PHP SDK, offering:

  • Facades for all OpenAI endpoints (responses, fineTuning, realtime, etc.) with Laravel’s dependency injection.
  • Configurable via .env (API keys, timeouts, base URLs) and type-safe responses.
  • Testing superpowers: Mock API calls to avoid rate limits during CI/CD (e.g., OpenAI::fake()).
  • Performance: Underlying Guzzle HTTP client with configurable timeouts (default: 30s). Example use case: Replace a manual curl call to OpenAI’s API with:
$response = OpenAI::responses()->create(['model' => 'gpt-5', 'input' => 'Summarize this...']);
echo $response->outputText;

No more JSON parsing or auth headaches."*

Risk Mitigation:

  • MIT license = no legal blockers.
  • Active maintenance (last release: June 2026).
  • Fallback: Use the base openai-php/client if Laravel-specific features aren’t needed.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/graphviz
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata