Metadata-Version: 2.4
Name: runtime-sdk
Version: 0.8.0
Summary: Python client for the Runtime HTTP API
Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.28.1

# runtime-sdk

`runtime-sdk` is the typed Python client for Runtime's HTTP API. It is separate
from the standalone `runtime` CLI and does not read or write CLI credentials.

## Install

```sh
python -m pip install runtime-sdk
```

## Use

Pass the API base URL and either an API key or a credential callback explicitly:

```python
from runtime_sdk import RuntimeClient

client = RuntimeClient(
    base_url="https://api.runruntime.dev",
    credential="sk_runtime_...",
)

computer = client.create_computer(slug="buildbox")
result = client.run_command(computer["id"], "uname -a")
print(result["stdout"])
client.delete_computer(computer["id"])
```

Credential callbacks are useful when the caller owns token rotation:

```python
client = RuntimeClient(
    base_url="https://api.runruntime.dev",
    credential=lambda: load_current_token(),
)
```

Methods accept a stable computer ID or slug where `computer_id` is named.
Authentication, validation, and HTTP failures raise `RuntimeAPIError`.

## Develop and release

```sh
cd backend
uv sync
uv run python -m unittest discover -s scripts/tests -p 'test_*.py'
uv run mypy scripts/runtime_sdk scripts/tests/runtime_sdk_typecheck_example.py
./scripts/release_runtime_sdk.sh
```

The release script builds one universal `py3-none-any` wheel. The wheel contains
only the Python client, response types/validation, transport, and `py.typed`; it
does not install a `runtime` command or bundle OpenTUI.
