Every resource method exposed by theDocumentation 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.
aisdk/elevenlabs package returns a strongly-typed PHP 8.3 value object from the AiSdk\ElevenLabs\Data namespace. These classes carry the exact response surface documented by ElevenLabs while hiding raw HTTP details behind well-named properties. Because each class is declared final readonly, instances are immutable and safe to pass around without defensive copying.
All data classes in
AiSdk\ElevenLabs\Data are final readonly PHP 8.3 value objects. Properties are set once at construction and can never be mutated. The rawResponse property present on most types gives you access to the full decoded API response for fields not promoted to first-class properties.Shared / Audio
BinaryData
BinaryData
BinaryData is the low-level container for raw binary payloads returned by stem-separation and other endpoints that produce a single file with a known MIME type. For the primary audio output of most resource methods, the SDK returns the AudioData type from aisdk/core instead (see the note below).The raw binary payload as a PHP string. Feed this directly to
file_put_contents or use save().The MIME type reported by the response, e.g.
audio/mpeg or application/zip. Defaults to application/octet-stream when the API does not specify one.An optional filename hint, populated when the API returns a
Content-Disposition header.save(string $path): string
Writes
data to the given file-system path. Returns the path on success, or throws AiSdkException if the write fails.AudioData and AudioResult come from aisdk/core, not this package. Core speech and transcription methods (Generate::speech(), Generate::transcription()) return AudioResult, whose output property is an AudioData instance. ElevenLabs resource methods that return audio (music composition, voice changer, dialogue, etc.) also surface their primary output as an AudioData under the output property of the relevant result type.Music
MusicPlan
MusicPlan
Returned by
ElevenLabs::music()->plan(). Wraps the raw composition-plan payload from ElevenLabs as a typed value object so it can be passed to composeFromPlan() without manual array juggling.The raw composition plan as an associative array, as returned by the ElevenLabs
/music/plan endpoint. Pass this instance directly to composeFromPlan().MusicUpload
MusicUpload
Returned by
ElevenLabs::music()->upload(). Uploading source audio registers it with ElevenLabs for composition-plan and inpainting workflows and returns its typed song ID alongside optional plan and timestamp metadata.The ElevenLabs song ID assigned to the uploaded audio. Use this in subsequent composition-plan or inpainting requests.
The composition plan generated for the uploaded source, if requested.
null when the plan was not requested or not returned by the API.Word-level timestamp data associated with the uploaded audio. Empty list when no timestamp data was returned.
The full decoded API response for access to any fields not promoted to dedicated properties.
DetailedMusicResult
DetailedMusicResult
Returned by
ElevenLabs::music()->composeDetailed(). Extends the basic audio output with composition metadata, song-level metadata, and an optional song ID for use in follow-up operations.The generated audio.
AudioData is the core SDK audio container — call save(string $path) on it to write the file to disk.The structured composition plan used to produce this track, as an associative array.
Song-level metadata returned by ElevenLabs (tempo, key, genre tags, and similar attributes) as an associative array.
The ElevenLabs song ID for the generated track, when returned by the API. Use this for inpainting or remix workflows.
The raw decoded metadata response for access to any fields not surfaced by the above properties.
Voice Design
VoicePreview
VoicePreview
A single voice-design or voice-remix preview, contained within the
previews list of a VoiceDesignResult. Each preview includes the generated audio and a generatedVoiceId that is the required input to voiceDesign()->create().The ephemeral voice ID for this preview. Pass this to
voiceDesign()->create() to permanently save it as a usable voice.The preview audio clip. Call
save(string $path) to persist it locally.The language the preview was generated in, when reported by the API.
VoiceDesignResult
VoiceDesignResult
Returned by
ElevenLabs::voiceDesign()->design() and ElevenLabs::voiceDesign()->remix(). Contains a list of generated voice previews plus the sample text that was spoken.The generated voice preview objects. Each entry has
generatedVoiceId, audio, and optionally language.The sample text spoken in the previews — either auto-generated or the text you supplied.
The full decoded API response.
CreatedVoice
CreatedVoice
Returned by
ElevenLabs::voiceDesign()->create(). Confirms that the selected preview has been permanently saved to your ElevenLabs account as a usable voice.The permanent ElevenLabs voice ID. Use this as the
voice_id in TTS and voice-changer requests.The name you assigned to the saved voice.
The voice category assigned by ElevenLabs (e.g.
generated), when present in the response.The description you supplied when creating the voice.
The full decoded API response.
Dialogue
CharacterAlignment
CharacterAlignment
Character-level timing metadata for a segment of synthesised dialogue. Used as the
alignment and normalizedAlignment properties of TimedDialogueResult.Ordered list of individual characters in the aligned segment.
Start time in seconds for each character in
characters, at the same index.End time in seconds for each character in
characters, at the same index.VoiceSegment
VoiceSegment
Describes a contiguous span of the output audio spoken by a single voice in a timed-dialogue result.
The ElevenLabs voice ID that spoke this segment.
Start time of this voice segment in seconds within the combined output audio.
End time of this voice segment in seconds within the combined output audio.
Zero-based character offset within the dialogue transcript where this segment begins.
Zero-based character offset within the dialogue transcript where this segment ends (exclusive).
Zero-based index into the original dialogue
inputs array that produced this segment.TimedDialogueResult
TimedDialogueResult
Returned by
ElevenLabs::dialogue()->withTimestamps(). Bundles the combined audio with per-character alignment data and per-voice segment boundaries.The combined dialogue audio. Call
save(string $path) to write it to disk.Raw character-level alignment from ElevenLabs.
null when the API did not return alignment data.Whitespace-normalised character-level alignment.
null when not returned by the API.One entry per contiguous voice span in the combined audio, describing which voice spoke when and which input dialogue entry it corresponds to.
The full decoded API response.
Dubbing
DubbingJob
DubbingJob
Returned by
ElevenLabs::dubbing()->create(). Represents the newly-submitted asynchronous dubbing job. Poll dubbing()->status($job->id) to track progress.The ElevenLabs dubbing job ID. Use this in all subsequent
status(), output(), and transcript() calls.The estimated processing time in seconds as reported by ElevenLabs at submission time.
The full decoded API response from the job-creation endpoint.
DubbingStatus
DubbingStatus
Returned by
ElevenLabs::dubbing()->status(). Reflects the current state of a dubbing job, including its source language, target languages, and any error message if the job failed.The dubbing job ID.
The display name of the dubbing job as recorded by ElevenLabs.
The current job state. Common values are
dubbing, dubbed, and failed.The detected or specified source language of the original media.
The language codes the content is being or has been dubbed into.
ISO 8601 creation timestamp for the job.
Whether the dubbing output can be edited in Dubbing Studio. Defaults to
false.The detected media type of the original content (e.g.
video/mp4).Duration of the original media in seconds, when known.
Human-readable error message when
status is failed.The full decoded API response.
DubbingTranscript
DubbingTranscript
Returned by
ElevenLabs::dubbing()->transcript(). Provides the dubbed transcript in the format you requested — either as a raw string (SRT, WebVTT) or as a structured array.The transcript format that was requested, e.g.
srt, webvtt, or json.The transcript as a raw string, populated for text-based formats such as
srt and webvtt. null when a structured format was returned instead.The transcript as a decoded associative array, populated for JSON-based formats.
null for text-based formats.The full decoded API response.
Forced Alignment
AlignmentItem
AlignmentItem
A single aligned unit — either a character or a word — as returned within a
ForcedAlignmentResult. Both the characters and words lists on that result are composed of AlignmentItem instances.The character or word that this item represents.
Start time of this unit in seconds within the aligned audio.
End time of this unit in seconds within the aligned audio.
The alignment loss score for this item, when returned by the API. Lower values indicate higher confidence alignment.
ForcedAlignmentResult
ForcedAlignmentResult
Returned by
ElevenLabs::forcedAlignment()->create(). Provides character- and word-level timing for every token in the supplied transcript, aligned against the audio you provided.Character-level alignment items, one per character in the transcript.
Word-level alignment items, one per word in the transcript.
The overall alignment loss for the full audio/transcript pair. Lower is better.
The full decoded API response.
