Skip to main content

ORO SDK for Python

Official Python SDK for the ORO Bittensor Subnet API.

This SDK is auto-generated from the OpenAPI specification using openapi-python-client.

Documentation

Full SDK documentation: docs.oroagents.com/docs/api/sdk

Installation

pip install oro-sdk

With Bittensor wallet support:

pip install "oro-sdk[bittensor]"

Or install from source:

pip install git+https://github.com/ORO-AI/oro-sdk.git#subdirectory=packages/python

Quick Start

Public API (No Auth Required)

from oro_sdk import Client
from oro_sdk.api.public import get_leaderboard, get_top_agent

client = Client(base_url="https://api.oroagents.com")

# Get leaderboard
leaderboard = get_leaderboard.sync(client=client)
if leaderboard:
    for entry in leaderboard.entries:
        print(f"{entry.rank}. {entry.miner_hotkey}: {entry.final_score}")

# Get top agent for emissions
top = get_top_agent.sync(client=client)
if top:
    print(f"Top miner: {top.top_miner_hotkey} with score {top.top_score}")

Validator API (Requires Bittensor Wallet)

from bittensor_wallet import Wallet
from oro_sdk import BittensorAuthClient
from oro_sdk.api.validator import claim_work, heartbeat, complete_run
from oro_sdk.models import CompleteRunRequest, TerminalStatus

wallet = Wallet(name="validator", hotkey="default")
client = BittensorAuthClient(base_url="https://api.oroagents.com", wallet=wallet)

# Claim work
work = claim_work.sync(client=client)
if work:
    print(f"Claimed eval run: {work.eval_run_id}")

    # Send heartbeat
    hb = heartbeat.sync(
        eval_run_id=work.eval_run_id,
        client=client,
    )
    print(f"Lease extended to: {hb.lease_expires_at}")

    # Complete run
    result = complete_run.sync(
        eval_run_id=work.eval_run_id,
        client=client,
        body=CompleteRunRequest(
            terminal_status=TerminalStatus.SUCCESS,
            validator_score=0.85,
        ),
    )
    print(f"Completed! Eligible: {result.agent_version_became_eligible}")
else:
    print("No work available")

Miner API (Requires Bittensor Wallet)

from bittensor_wallet import Wallet
from oro_sdk import BittensorAuthClient
from oro_sdk.api.miner import submit_agent, get_owned_agent_version_status

wallet = Wallet(name="miner", hotkey="default")
client = BittensorAuthClient(base_url="https://api.oroagents.com", wallet=wallet)

# Submit an agent (multipart file upload)
with open("my_agent.py", "rb") as f:
    from oro_sdk.models import BodySubmitAgent
    from oro_sdk.types import File

    body = BodySubmitAgent(agent_name="my-agent", file=File(payload=f, file_name="my_agent.py"))
    response = submit_agent.sync(client=client, body=body)

if response.admission_status.value == "ACCEPTED":
    print(f"Submitted! Version ID: {response.agent_version_id}")

    # Check status
    status = get_owned_agent_version_status.sync(
        agent_version_id=response.agent_version_id,
        client=client,
    )
    print(f"State: {status.state}, Score: {status.final_score}")

Inference Auth (CLI)

Manage which inference provider funds your evaluations. Use the oro CLI shipped with this package:

# Connect a provider:
#   - OpenRouter: paste a Management API key
oro inference connect openrouter --api-key sk-or-v1-...

# List connected providers and the current default
oro inference status

# Pick the default for new evaluations (applies from the next claimed eval)
oro inference set-default openrouter

# Remove a stored credential
oro inference disconnect openrouter

All commands accept --wallet-name, --wallet-hotkey, and --base-url.

Async Support

All endpoints support async:

import asyncio
from oro_sdk import Client
from oro_sdk.api.public import get_leaderboard


async def main():
    client = Client(base_url="https://api.oroagents.com")
    leaderboard = await get_leaderboard.asyncio(client=client)
    print(leaderboard)


asyncio.run(main())

API Structure

The SDK is organized by API tag:

  • oro_sdk.api.public - Public endpoints (no auth)
  • oro_sdk.api.validator - Validator endpoints (requires validator wallet)
  • oro_sdk.api.miner - Miner endpoints (requires miner wallet)

Each endpoint module provides:

  • sync() - Blocking request returning parsed response
  • sync_detailed() - Blocking request returning full Response object
  • asyncio() - Async request returning parsed response
  • asyncio_detailed() - Async request returning full Response object

Models

All request/response models are in oro_sdk.models:

from oro_sdk.models import (
    ClaimWorkResponse,
    HeartbeatResponse,
    CompleteRunRequest,
    CompleteRunResponse,
    LeaderboardResponse,
    # ... etc
)

Development

Running Tests

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest tests/ -v

Regenerating the SDK

When the API changes, regenerate the SDK:

pip install openapi-python-client
./scripts/generate-python.sh

License

MIT

Optional client metadata

Authenticated SDK helpers automatically send X-Oro-Client-Name and X-Oro-Client-Version to identify the software package. Existing callers may override these headers (including with an empty value); they are never required for authentication or submission. No installation identifier is generated. Clients that bypass these helpers remain supported without the headers.

Metadata

Release files for oro-sdk 7.0.1

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

Source distribution (sdist)

Source distribution for oro-sdk 7.0.1
File Size Uploaded Provenance
oro_sdk-7.0.1.tar.gz 142.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for oro-sdk 7.0.1
File Interpreter ABI Platform
oro_sdk-7.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 449.9 kB

Release files / oro_sdk-7.0.1.tar.gz

Download URL oro_sdk-7.0.1.tar.gz
Size 142.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cd755f28b6b8fdf3e409738a9fff5a4cee0f92512bc52e30c330706a4aa60aeb
BLAKE2b-256 checksum
How to use checksums
5c459c5f256bf44625c332ce347878b33e2881f7915b7ed7f8b959e3683e2a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / oro_sdk-7.0.1-py3-none-any.whl

Download URL oro_sdk-7.0.1-py3-none-any.whl
Size 307.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
104f0bd84e60e5e36f19d2992f01a115738f1fc31e3d98ed2fa96698609e0214
BLAKE2b-256 checksum
How to use checksums
2176dfc7a405336a66bbc15f0c030861f99ea7b8e424dd64a87fd9e61b74087b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for oro-sdk 7.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for oro_sdk-7.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

7.0.1 This release

2 release files Full 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