> For the complete documentation index, see [llms.txt](https://cluster-protocol.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cluster-protocol.gitbook.io/whitepaper/technical-architecture/python-sdk.md).

# Python SDK

The official Python SDK is available on PyPI:

```
pip install cluster-sdk
```

The SDK provides a unified client for inference, data access, and on-chain queries:

python

```python
from cluster import ClusterClient

client = ClusterClient(api_key="your_key")

# Inference
response = client.chat.completions.create(
    model="meta-llama/llama-3.1-70b-instruct",
    messages=[{"role": "user", "content": "Hello"}]
)

# List datasets
datasets = client.datasets.list()

# Download dataset
client.datasets.download("dataset-slug", path="./data")
```

The SDK handles authentication, retries, streaming, and error handling. It follows the standard client pattern for familiarity.
