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

# Python SDK

> REST-first Python integration patterns for the live ThreeTone API

Use Python against the live ThreeTone API today with `requests`. When the
official SDK is published, these auth and payload conventions will remain the
same, so you can migrate incrementally.

## Install dependencies

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

## Create an agent

```python theme={null}
import requests

url = "https://api.threetone.in/v1/convai/agents/create"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}
payload = {
    "name": "Customer Support Agent",
    "system_prompt": "You are a helpful customer support representative.",
}

response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json()["agent_id"])
```

Canonical source file: `/examples/python/create_agent.py`

## Verify a webhook signature

```python theme={null}
import hashlib
import hmac

def is_valid_signature(payload: bytes, signature: str, secret: str) -> bool:
    digest = hmac.new(secret.encode("utf-8"), payload, hashlib.sha256).hexdigest()
    return hmac.compare_digest(f"sha256={digest}", signature)
```

Canonical source file: `/examples/python/verify_webhook.py`

## Next steps

* [Authentication](/guides/authentication)
* [Python examples](/sdks/examples/python-examples)
* [API reference](/api-reference/introduction)
