Lamina Labsdocs

Python SDK

Async-first Python SDK: generate, stream events, or use callbacks.

install
pip install lamina-sdk

Python 3.11 or newer is required. Set LAMINA_API_KEY in your environment, or pass api_key directly.

Quick start

from lamina import simi

async with simi(api_key="lamina_live_your_key") as client:
    video = await client.generate(
        "A narrated lesson about derivatives",
        duration=1,
    )
    await video.save("out.mp4")

Stream events

async with simi() as client:
    job = await client.submit_async(
        "Explain our refund policy",
        duration=1,
        document="policy.pdf",
    )
    async for event in client.stream_events(job):
        print(event.type)

Callback style

async with simi() as lamina:
    job = await lamina.submit_async("A narrated lesson about derivatives")
    job.onstream(lambda event: print(event.type))
    job.oncompletion(lambda video: print(f"Ready: {video.job_id}"))
    await job.wait()