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

# Python SDK Installation

> Install and configure the Shannon Python SDK

## Install

```bash theme={null}
pip install shannon-sdk
```

From source (dev):

```bash theme={null}
git clone https://github.com/Kocoro-lab/Shannon.git
cd Shannon/clients/python
pip install -e .
```

Optional (WebSocket streaming support):

```bash theme={null}
pip install websockets
```

## Quick Verify

```python theme={null}
from shannon import ShannonClient
client = ShannonClient(base_url="http://localhost:8080")
print("✓ SDK ready")
```

## Auth

```python theme={null}
from shannon import ShannonClient
client = ShannonClient(
  base_url="http://localhost:8080",
  api_key="sk_test_123"
)
```

Env-driven:

```python theme={null}
import os
from shannon import ShannonClient
client = ShannonClient(
  base_url=os.getenv("SHANNON_BASE_URL", "http://localhost:8080"),
  api_key=os.getenv("SHANNON_API_KEY"),
)
```

## Client Options

| Param             | Type  | Default                 | Notes                               |
| ----------------- | ----- | ----------------------- | ----------------------------------- |
| `base_url`        | str   | `http://localhost:8080` | Gateway HTTP URL                    |
| `api_key`         | str   | None                    | Sent as `X-API-Key`                 |
| `bearer_token`    | str   | None                    | Alternative `Authorization: Bearer` |
| `default_timeout` | float | `30.0`                  | Seconds                             |

## Async Client

```python theme={null}
import asyncio
from shannon import AsyncShannonClient

async def main():
  async with AsyncShannonClient(base_url="http://localhost:8080") as client:
    h = await client.submit_task("Analyze data")
    s = await client.wait(h.task_id)
    print(s.result)

asyncio.run(main())
```

## CLI

```bash theme={null}
python -m shannon.cli --base-url http://localhost:8080 submit "What is 2+2?" --wait
```
