Metadata-Version: 2.5
Name: openrelay-sdk
Version: 0.1.0
Summary: The official Python SDK for the OpenRelay API
Project-URL: Homepage, https://openrelay.inc
Project-URL: Documentation, https://docs.openrelay.inc
Project-URL: Repository, https://github.com/OpenRelayInc/OpenRelay
Project-URL: Issues, https://github.com/OpenRelayInc/OpenRelay/issues
License-Expression: MIT
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.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: httpx<1,>=0.25.0
Requires-Dist: pydantic<3,>=2.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: respx>=0.20; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Description-Content-Type: text/markdown

# OpenRelay Python SDK

The official Python SDK for the [OpenRelay](https://openrelay.inc) API.

## Installation

```bash
pip install openrelay-sdk
```

The package imports as `openrelay`. The unrelated `openrelay` distribution on
PyPI also provides a top-level `openrelay` module, so install `openrelay-sdk`,
and do not install both into the same environment.

From a checkout of this repository: `pip install ./sdks/python`.

## Quick Start

```python
import openrelay

client = openrelay.Client(api_key="or_your_api_key")

# List available GPUs
gpus = client.gpus.list()

# Create a VM
vm = client.vms.create(
    name="dev-box",
    ssh_key_ids=["your-ssh-key-id"],
    gpu_type="rtx-4090",
    gpu_count=1,
    disk_size_gb=100,
)

# Wait for it to be ready
vm = client.vms.wait_for_status(vm.id)
print(f"VM running at: {vm.endpoint_url}")
```

## Async Usage

```python
import asyncio
import openrelay

async def main():
    async with openrelay.AsyncClient(api_key="or_your_api_key") as client:
        vm = await client.vms.get("your-vm-id")
        print(vm.status)

asyncio.run(main())
```

## Configuration

The client accepts these parameters:

| Parameter | Env Variable | Default |
|-----------|-------------|---------|
| `api_key` | `OPENRELAY_API_KEY` | Required |
| `base_url` | `OPENRELAY_API_URL` | `https://api.openrelay.inc` |
| `timeout` | (none) | `60.0` seconds |
| `max_retries` | (none) | `2` |

The `orl` CLI reads the same two variables.

## License

MIT
