Skip to main content

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

python -m pip install runtime-sdk

Use

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

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:

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

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

runtime_sdk-0.8.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file runtime_sdk-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: runtime_sdk-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for runtime_sdk-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f16607d69b78a834fd56f7ab98bbb0a2044544f4259d311c7289a84f220823b
MD5 e6c1a66b3f52186fbb8100a290e2dec6
BLAKE2b-256 23557c191998318036ac752e137739f20363a39e02e270ce8c23284368b8dd22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page