Search by

aisdk / openai

aisdk

Official OpenAI provider for the PHP AI SDK.

Package info

github.com/phpaisdk/openai

pkg:composer/aisdk/openai

Fund package maintenance!

Open Collective

Statistics

Installs: 81

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.11.1 2026-11-11 04:09 UTC

README

Text, image, speech, transcription, and embedding generation, plus real-time voice with OpenAI. Part of the framework-agnostic PHP AI SDK.

Installation

composer require aisdk/openai

Set OPENAI_API_KEY in your environment.

Usage

use AiSdk\Generate;
use AiSdk\OpenAI;

$result = Generate::text('Explain closures in PHP in one sentence.')
    ->model(OpenAI::model('gpt-6.1-sol'))
    ->run();

echo $result->text;

For streaming, call ->stream() instead of ->run(). Install aisdk/transport for server-side live sessions.

Documentation

Read the documentation for configuration, supported features, and more examples.

Contributing ยท Support

License

The MIT License (MIT). See LICENSE for details.