A community-maintained PHP API client for interacting with OpenAI's API, including chat, audio, images, and fine-tuning.
OpenAI PHP is a community-maintained PHP API client that provides a fluent interface for interacting with OpenAI's API. It allows PHP developers to integrate AI capabilities like chat completions, audio generation, image creation, and embeddings into their applications. The client solves the problem of manually crafting HTTP requests to OpenAI by offering a clean, object-oriented PHP wrapper.
PHP developers building applications that require AI features such as chatbots, content generation, image manipulation, or audio processing. It's ideal for Laravel, Symfony, or any PHP-based project needing OpenAI integration.
Developers choose OpenAI PHP because it's a dedicated, community-maintained client that offers full API coverage, streaming support, and a fluent PHP-friendly interface. It simplifies integration compared to raw HTTP calls and is actively updated to match OpenAI's API changes.
⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports all major and legacy OpenAI endpoints, including chat, audio, images, embeddings, and fine-tuning, as detailed in the extensive resource sections like Responses, Conversations, and Vector Stores.
Includes methods for streaming responses, audio, and images, enabling live interactions without blocking, as demonstrated in createStreamed examples across chat, audio, and image resources.
Offers an object-oriented API that mirrors OpenAI's structure, making request construction straightforward with method chaining, such as $client->chat()->create() for common operations.
Allows custom HTTP clients, headers, base URIs, and organization settings via a factory pattern, providing flexibility for various environments, as shown in the withBaseUri and withHttpClient examples.
Requires PHP 8.2 or higher, which can be a barrier for projects stuck on older PHP versions due to legacy code or hosting constraints, limiting adoption in some environments.
Relies on PSR-18 HTTP client discovery or manual installation of packages like Guzzle, adding an extra configuration step that might confuse newcomers or complicate deployments.
As a community-driven project, updates might lag behind OpenAI's official API changes, and there's no guaranteed support compared to official SDKs, posing a risk for critical applications.