Skip to main content
The History client provides methods to manage and retrieve your generated audio history items.

list

Returns a list of your generated audio.

Parameters

int
How many history items to return at maximum. Cannot exceed 1000, defaults to 100.
str
After which ID to start fetching, use this parameter to paginate across a large collection of history items. If not provided, history items will be fetched starting from the most recently created one ordered descending by their creation date.
str
ID of the voice to be filtered for. You can use the Get voices endpoint to list all available voices.
str
Model ID used for filtering history items.
int
Unix timestamp to filter history items before this date (exclusive).
int
Unix timestamp to filter history items after this date (inclusive).
str
Sort direction for the results. Can be “asc” or “desc”.
Search term used for filtering.
str
Source of the generated history item (e.g., “TTS”).
RequestOptions
Request-specific configuration.

Response

object
Returns a list of speech history items.

Example


get

Retrieves a specific history item by ID.

Parameters

str
required
ID of the history item to retrieve. You can use the list endpoint to get a list of history items.
RequestOptions
Request-specific configuration.

Response

object
Returns the requested history item with its metadata.

Example


delete

Delete a history item by its ID.

Parameters

str
required
ID of the history item to delete. You can use the list endpoint to get a list of history items.
RequestOptions
Request-specific configuration.

Response

object
Returns confirmation of the deletion.

Example


get_audio

Returns the audio of a history item.

Parameters

str
required
ID of the history item to retrieve audio for. You can use the list endpoint to get a list of history items.
RequestOptions
Request-specific configuration. You can pass in configuration such as chunk_size to customize the request and response.

Response

Iterator[bytes]
Returns the audio file of the history item as an iterator of bytes.

Example


download

Download one or more history items. If one history item ID is provided, returns a single audio file. If multiple history item IDs are provided, returns a .zip file.

Parameters

List[str]
required
A list of history items to download. You can get IDs of history items using the list endpoint.
str
Output format to transcode the audio file. Can be “wav” or “default”.
RequestOptions
Request-specific configuration. You can pass in configuration such as chunk_size to customize the request and response.

Response

Iterator[bytes]
Returns the requested audio file, or a zip file containing multiple audio files when multiple history items are requested.

Example


Async Methods

All methods are also available as async methods using AsyncElevenLabs client: