> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openspline.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream audio on Cloud

> Create an avatar session on OpenSpline GPUs with a Cloud API key.

Create a key in the [Cloud dashboard](https://dashboard.openspline.dev/developers). Keep it on your backend.

```bash theme={null}
pip install openspline
export OPENSPLINE_API_KEY="YOUR_API_KEY"
```

```python theme={null}
from openspline import Openspline

async with Openspline().avatar("portrait.jpg") as avatar:
    print(avatar.viewer_url)
    await avatar.stream(agent.audio_stream(), sample_rate=24000)
```

Open the printed URL to watch playback. `agent.audio_stream()` is your async iterator of PCM16 chunks; `sample_rate` is in Hz.

Use a portrait saved in the dashboard:

```python theme={null}
async with Openspline().avatar(avatar_id="YOUR_AVATAR_ID") as avatar:
    print(avatar.viewer_url)
    await avatar.stream(agent.audio_stream(), sample_rate=24000)
```

Pass `avatar.session` to your [frontend](/guides/frontend). For Node, use the [Node SDK](/sdk/node).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.