Skip to main content

runtimeai

Official Python SDK for the RuntimeAI Control Plane — govern, secure, and observe AI agents at scale.

Installation

pip install runtimeai

Quick Start

from runtimeai import RuntimeAI

client = RuntimeAI(
    "https://api.rt19.runtimeai.io",
    api_key="your-api-key",
)

# Register an AI agent
agent = client.agents.register(
    name="contract-analyzer",
    type="langchain",
    owner="ml-team@company.com",
    risk_level="medium",
)
print(f"Agent registered: {agent['id']}")

# Discover shadow AI usage
findings = client.discovery.list_findings()
print(f"Found {len(findings.get('findings', []))} shadow AI instances")

# Track costs
client.finops.report_usage(
    agent_id=agent["id"],
    model="gpt-4",
    provider="openai",
    input_tokens=1500,
    output_tokens=800,
    cost_usd=0.045,
)

# Check compliance posture
frameworks = client.compliance.list_frameworks()
for fw in frameworks.get("frameworks", []):
    print(f"{fw['name']}: {fw['compliance_pct']}% compliant")

Authentication

API Key

client = RuntimeAI(
    "https://api.your-pod.runtimeai.io",
    api_key="your-api-key",  # X-API-Key header
)

JWT Token

client = RuntimeAI(
    "https://api.your-pod.runtimeai.io",
    auth_token="your-jwt-token",  # Authorization: Bearer header
    tenant_id="your-tenant-id",   # X-Tenant-ID header
)

Available Clients

Client Methods
client.agents register, list, get, update, kill_switch, get_trust_score, heartbeat
client.discovery list_findings, triage_finding, list_scanners, configure_scanner, ingest
client.finops report_usage, get_usage_summary, list_budgets, set_budget, get_cost_attribution
client.policies list_guardrails, create_guardrail, list_sod_rules, list_conditional_access, evaluate
client.mcp list_tools, register_tool, invoke_tool, list_connections, get_topology
client.compliance list_frameworks, list_gaps, upload_evidence, list_risk_scores
client.audit list, search, get

Configuration

Option Type Default Description
api_url str — Required. Control Plane API URL
api_key str "" API key (X-API-Key header)
auth_token str "" JWT token (Bearer header)
tenant_id str "" Tenant ID for multi-tenant ops
timeout int 30 HTTP timeout in seconds
max_retries int 2 Max retries on 5xx errors

Error Handling

from runtimeai import RuntimeAI, RuntimeAIError

try:
    agent = client.agents.get("nonexistent-id")
except RuntimeAIError as e:
    print(f"API Error: {e.status_code} {e.code} — {e}")

Requirements

  • Python >= 3.9
  • Zero runtime dependencies (stdlib urllib only)

License

MIT © RuntimeAI

Metadata

Release files for runtimeai 1.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 runtimeai 1.1.0
File Size Uploaded Provenance Actions
runtimeai-1.1.0.tar.gz 12.4 kB Without provenance Details for runtimeai-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runtimeai 1.1.0
File Interpreter ABI Platform Actions
runtimeai-1.1.0-py3-none-any.whl Python 3 none any Details for runtimeai-1.1.0-py3-none-any.whl

Total release size: 25.5 kB

Release files / runtimeai-1.1.0.tar.gz

Download URL runtimeai-1.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fc73775d870ece2e21eb04855421d8b5486df37b9822b0c7b19dde01d08f6ecd
BLAKE2b-256 checksum
How to use checksums
2b623145bf1450c9b49e1c3776da6fe9d6822b0f6f23d40af197aaf431a48c61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / runtimeai-1.1.0-py3-none-any.whl

Download URL runtimeai-1.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d017a305a6f844160bd708c060244eec6a03b01131e8b5a27e2d336ebae2718
BLAKE2b-256 checksum
How to use checksums
d0924e662efbe45e80059b7b5081c8a3b2662e86ed4ede556233b844d01aafdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for runtimeai 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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