aisdk / transport
Ready-made Live transport implementations for the PHP AI SDK.
Fund package maintenance!
v0.11.0
2026-10-31 02:59 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.11.0
- amphp/amp: ^3.0
- amphp/byte-stream: ^2.0
- amphp/http-client: ^5.0
- amphp/websocket-client: ^2.0
Requires (Dev)
- amphp/socket: ^2.0
- laravel/pint: ^1.18
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
WebSocket and bidirectional HTTP/2 transports for PHP AI SDK live sessions. Transport selection follows the endpoint supplied by your provider.
Installation
composer require aisdk/transport aisdk/xai
Set XAI_API_KEY in your environment for this example. Install the provider package you intend to use.
Usage
use AiSdk\Live; use AiSdk\Transport; use AiSdk\XAI; $session = Live::voice() ->model(XAI::model('grok-voice-latest')) ->voice('eve') ->connect(Transport::auto()); // Send microphone audio and consume session events in your application. $session->close();
Use Transport::webSocket() or Transport::http2() when you need an explicit transport.
Documentation
Read the documentation for configuration, supported features, and more examples.
License
The MIT License (MIT). See LICENSE for details.