Skip to main content

OpenRelay Python SDK

The official Python SDK for the OpenRelay API.

Installation

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

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

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

Metadata

Release files for openrelay-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openrelay-sdk 0.1.0
File Size Uploaded
openrelay_sdk-0.1.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openrelay-sdk 0.1.0
File Interpreter ABI Platform
openrelay_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / openrelay_sdk-0.1.0.tar.gz

Download URL openrelay_sdk-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
586f03a4f47bc26c670ab0a6559e2557efde2e624d6e1a228848f5d2fb7e6e03
BLAKE2b-256 checksum
How to use checksums
b4d45b768d3341da03f432bbae01305430486a5a6a44174cf6e6b1d972f449cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / openrelay_sdk-0.1.0-py3-none-any.whl

Download URL openrelay_sdk-0.1.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea729e71e694d8346683b07fa0b0306554e441cd171860eadb79d79f3f25876c
BLAKE2b-256 checksum
How to use checksums
a16cab84b61754c65a3e716273735c16125da69c89169ecfa19fcb82e807e7fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page