Metadata-Version: 2.4
Name: borealhost-sdk
Version: 0.1.0
Summary: Python SDK for the BorealHost.ai REST API — agent-native web hosting
Project-URL: Homepage, https://borealhost.ai
Project-URL: Documentation, https://borealhost.ai/api/v1/docs/
Project-URL: Repository, https://github.com/alainsvrd/platform
Author-email: BorealHost <hello@borealhost.ai>
License: MIT
Keywords: api,borealhost,hosting,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Description-Content-Type: text/markdown

# BorealHost Python SDK

Python SDK for the [BorealHost.ai](https://borealhost.ai) REST API.

BorealHost is an agent-native Quebec-based web hosting platform. This SDK wraps the full public REST API (`/api/v1/*`) — purchase hosting, deploy sites, manage DNS, register domains, run SSH commands, and scale infrastructure.

## Install

```bash
pip install borealhost-sdk
```

## Usage

```python
from borealhost_sdk import Client

client = Client(api_key="bh_...")

# List plans (no auth needed)
plans = client.list_plans()

# Manage sites
sites = client.list_sites()
status = client.get_site("my-site")
client.deploy("my-site")

# DNS
client.add_domain_dns("example.com", record_type="A", value="1.2.3.4", subdomain="www")
```

## Authentication

API keys are in the format `bh_<48 hex chars>`.

```python
# Pass at construction
client = Client(api_key="bh_...")

# Or via environment variable
# export BOREALHOST_API_KEY="bh_..."
client = Client()

# Or set later
client = Client()
client.set_api_key("bh_...")
```

## Custom base URL

```python
client = Client(api_key="bh_...", base_url="https://staging.borealhost.ai")
```

## Errors

All errors from the API raise `ApiError`:

```python
from borealhost_sdk import Client, ApiError

try:
    client.deploy("unknown-site")
except ApiError as e:
    print(e.code)     # "NOT_FOUND"
    print(e.message)  # "Site 'unknown-site' not found"
```

## Related packages

- [`borealhost`](https://pypi.org/project/borealhost/) — command-line tool (`bh`)
- [`borealhost-mcp`](https://pypi.org/project/borealhost-mcp/) — MCP server for AI agents

## Links

- API docs: https://borealhost.ai/api/v1/docs/
- Homepage: https://borealhost.ai
