Skip to main content
def voices_list(client: Cartesia) -> None:
    """List voices with pagination."""
    print("loading page 1...")
    page = client.voices.list()
    voices = list(page.data)

    # loaded 1 page
    print("loaded", len(voices))

    for i in range(2, 4):
        if not page.has_next_page():
            break
        print(f"loading page {i}...")
        page = page.get_next_page()
        voices.extend(page.data)
        print("loaded", len(voices))

    print([voices[0], "..."])
From cartesia-python/examples/examples.py:499

Run this example

git clone --branch v3.2.0 https://github.com/cartesia-ai/cartesia-python
cd cartesia-python
uv sync
CARTESIA_API_KEY=YOUR_KEY uv run examples/examples.py voices_list