InstallingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/openai-compatible/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/openai-compatible gives you the full set of shared OpenAI-compatible wire-format adapters — request builders, response parsers, and SSE stream parsers — that you can use as the foundation of any PHP AI SDK provider package. This package is intended for provider package authors, not for end-user application developers. If you are writing a provider that speaks the OpenAI-compatible API (chat completions or image generation), add this package as a dependency rather than reimplementing the wire format yourself.
This package has a minimum stability of
alpha. Add "minimum-stability": "alpha" and "prefer-stable": true to your provider’s composer.json if you have not already done so.Require the Package
aisdk/core ^0.2 as a transitive dependency, which provides the portable contracts (TextModelRequest, ImageRequest, TextModelResponse, ImageResponse, StreamPart, etc.) that the adapter translates to and from.
Required Dependencies
The followingrequire section reflects the real constraints declared in the package’s composer.json:
Autoloading
The package registers a single PSR-4 namespace. Aftercomposer install, all public classes are available under AiSdk\OpenAICompatible\:
composer.json beyond the require entry — Composer’s autoloader handles the rest.
Verify the Installation
After runningcomposer require, confirm the package is installed and check which version was resolved: