Skip to content

Python SDK

The Python SDK exposes two clients:

ClientUse case
AsyncRuntaAsync applications and services.
RuntaSync scripts, notebooks, and command-line workflows.
Terminal window
pip install runta-sdk

When working from the SDK source repository, install it in editable mode:

Terminal window
uv pip install -e .

The SDK needs a tenant token. The hosted REST API endpoint defaults to https://api.runta.dev.

Terminal window
export RUNTA_TOKEN=rt_your_token

For a local or custom API endpoint:

Terminal window
export RUNTA_ENDPOINT=http://127.0.0.1:8080

You can also pass explicit values:

from runta import AsyncRunta
runta = AsyncRunta(
endpoint="http://127.0.0.1:8080",
token="rt_your_token",
)

Use either client as a context manager so the underlying HTTP resources are closed cleanly.

import asyncio
from runta import AsyncRunta
async def main():
async with AsyncRunta() as runta:
runtime = await runta.runtimes.create("hello-async")
result = await runtime.exec("echo hello world")
print(result.stdout_text)
await runtime.delete()
asyncio.run(main())