Metadata-Version: 2.4
Name: withruntime-cloud
Version: 0.1.0
Summary: Runtime Cloud client for agent sandboxes and cloud services
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Runtime Cloud Python SDK

Python 3.10+, no runtime dependencies. Install with
`python -m pip install withruntime-cloud`. Set `RUNTIME_API_KEY` through your
server-side secret manager. The default API is `https://api.withruntime.com`;
`RUNTIME_API_URL` can select a test environment. One Runtime client holds product
namespaces, beginning with `cloud.sandboxes`, and shared authentication and retries.

```python
from runtime_cloud import Runtime

cloud = Runtime()
sandbox = cloud.sandboxes.create({
    "funding": "trial",
    "region": "us-east-vin", "vcpu": 2, "memoryMiB": 4096, "diskMiB": 10240,
    "durationSeconds": 600, "cpuMode": "shared", "cpuFloorMillis": 250,
    "memoryGuarantee": "guaranteed",
}, idempotency_key="job-create-1")
try:
    cloud.sandboxes.wait_until_running(sandbox["id"])
    result = cloud.sandboxes.exec(sandbox["id"], ["python3", "-c", "print(6 * 7)"],
                                 idempotency_key="job-exec-1")
    print(result["stdout"])
finally:
    cloud.sandboxes.stop(sandbox["id"], idempotency_key="job-stop-1")
    cloud.sandboxes.wait_until_stopped(sandbox["id"])
```

The same client exposes `services`, `secrets`, `jobs` and `notices`. Public access
is controlled by the server; those products remain closed at the sandbox launch.
A stop request is asynchronous: use `get` to confirm `stopped`.

Calls are synchronous. In an async framework, wrap them with `asyncio.to_thread`
or use the framework's native MCP integration. A failed transport does not prove
a write failed. Reuse the exception's `idempotency_key` and identical input.
