Metadata-Version: 2.4
Name: vesta-sdk
Version: 0.2.0
Summary: Vestavision Model API Python SDK (OpenAPI-generated + façade)
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: urllib3>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2
Requires-Dist: typing-extensions>=4.7.1
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"

# vesta-sdk

Python SDK for the Vestavision Model API.

OpenAPI types and HTTP live under `vesta_sdk/generated/` (regenerate with `make sdk` from the Hub repo). The public façade in `vesta_sdk/__init__.py` adds `Key` auth, `wait` / `subscribe`, typed `APIError`, and webhook verification.

## Install

```bash
pip install -e ./sdk/python
# or: pip install vesta-sdk
```

## Usage

```python
import os
from vesta_sdk import VestaClient, verify_webhook_signature

client = VestaClient(os.environ["VESTA_API_KEY"])
# client = VestaClient(os.environ["VESTA_API_KEY"], base_url="http://127.0.0.1:18080")

models = client.list_models()
submitted = client.submit(
    "vesta/face-landmarks",
    {"image_url": "https://example.com/face.jpg"},
    idempotency_key="demo-1",
)
done = client.wait(submitted.request_id)
print(done.status, done.output)

# Outbound webhook: hex HMAC-SHA256 of raw body (X-Vesta-Signature)
verify_webhook_signature(secret, raw_body, signature_header)
```

| Method | Use |
|--------|-----|
| `submit` | Start inference (`idempotency_key` optional) |
| `wait` | Poll until completed / failed / canceled |
| `subscribe` | Submit async then `wait` |
| `list_models` / `get_model` | Catalog |
| `list_requests` / `get_request` / `cancel` | Jobs |
| `credits` | Balance |
| `presign_upload` | Input upload URL |

Auth: `Authorization: Key vh_…`. Model ids may contain `/` (e.g. `vesta/face-landmarks`).

Regenerate from Hub: `make sdk` (requires Docker). Spec: `docs/openapi/model-api.v1.yaml`.

```bash
PYTHONPATH=. pytest -q
```
