RunningDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/elevenlabs/llms.txt
Use this file to discover all available pages before exploring further.
composer require aisdk/elevenlabs installs the ElevenLabs provider and its only production dependency, aisdk/core. The core package provides the shared Generate, Live, Content, and contract layer that all PHP AI SDK providers build on. No other runtime dependencies are required for speech generation, batch transcription, or the media service extensions.
Requirements: PHP ^8.3 and
aisdk/core ^0.8.0. The package is published on Packagist as aisdk/elevenlabs.Installation Steps
Install the package
Add This installs the provider and
aisdk/elevenlabs to your project using Composer:aisdk/core. All speech, transcription, and media service capabilities are available immediately after this step.Set your API key
The simplest configuration is a single environment variable. Export it in your shell, add it to your The provider reads
.env file, or inject it through your host’s secrets management:ELEVENLABS_API_KEY automatically. No further PHP configuration is required if the environment variable is present when the application boots.Install the WebSocket transport (optional)
Realtime transcription via Once installed, pass
Live::transcribe() requires a WebSocket transport. Install the ready-made aisdk/transport package to get one:Transport::auto() when connecting a realtime session:aisdk/transport is optional. You can pass any application transport that implements AiSdk\Live\Contracts\TransportInterface instead. Provider event encoding and normalization always come from aisdk/elevenlabs regardless of which transport you use.Requirements Summary
| Requirement | Version |
|---|---|
| PHP | ^8.3 |
aisdk/core | ^0.8.0 |
aisdk/transport | Optional — realtime transcription only |
Verifying the Installation
After installation, confirm everything is wired up by resolving a model reference. This exercises the autoloader and the environment-variable lookup without making a network request:ELEVENLABS_API_KEY is not set and you have not called ElevenLabs::create() with an explicit key, the SDK will throw an exception at this point, which is the right time to discover a missing key rather than at the first actual API call.