All provider guides

Set up ElevenLabs

PHP

Researched from ElevenLabs's official documentation on 2026-11-02. Not yet walked through end to end.

  1. Current: Create or sign in to your account

    In ElevenLabs, open Developers and select the API Keys tab.

  2. Not started: Create a restricted API key

    Name a separate application key, allow the speech synthesis endpoints it needs and choose an appropriate credit limit. Keep useful restrictions enabled.

  3. Not started: Choose a model and voice

    Select a speech synthesis model and voice that your account can use. Set their identifiers on your own machine as PRISM_SETUP_MODEL and PRISM_SETUP_VOICE; the example does not create or clone a voice.

  4. Not started: Configure your .env

    Use the environment names below in your own application. Keep its environment file out of source control. Never paste a key into this website.

  5. Not started: Run the local check

    Choose a model you can use and run the matching example below on your own machine. Check any applicable usage charges first.

This provider is available in PHP Prism. The TypeScript and Python ports do not implement it.

Configure and verify locally

Environment names and defaults below come from the installed package. Choose a model you can use by setting PRISM_SETUP_MODEL on your machine. Run the verification only when you are ready for one billed request. No request is sent by this page.

php environment names
# Set ELEVENLABS_API_KEY privately if required for your configuration.
# url (default)
# ELEVENLABS_URL=https://api.elevenlabs.io/v1/
php local verification
use Prism\Prism\Facades\Prism;

// Run in your own configured Laravel application.
$model = getenv('PRISM_SETUP_MODEL');
if (!$model) {
    throw new RuntimeException('Set PRISM_SETUP_MODEL to a model your account can use.');
}
try {
    $voice = getenv('PRISM_SETUP_VOICE');
    if (!$voice) {
        throw new RuntimeException('Set PRISM_SETUP_VOICE to a voice your account can use.');
    }
    $result = Prism::audio()
        ->using('elevenlabs', $model)
        ->withVoice($voice)
        ->withInput('Hello.')
        ->withProviderOptions(['model_id' => $model])
        ->asAudio();
    echo strlen($result->audio->rawContent()), ' audio bytes', PHP_EOL;
} catch (Throwable $error) {
    echo get_class($error), PHP_EOL;
}

Official sources