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 6.0.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 oro-sdk 6.0.0
File Size Uploaded
oro_sdk-6.0.0.tar.gz 137.9 kB Details

Built distribution (wheel)

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

Total release size: 436.4 kB

Release files / oro_sdk-6.0.0.tar.gz

Download URL oro_sdk-6.0.0.tar.gz
Size 137.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b43d1141dcf29130c165fee4eeb461dbfb5856808d18bad8dc9ea25edc9a53fd
BLAKE2b-256 checksum
How to use checksums
e7db68fff0730069bf74ce05f109feaf8260dadb744cf684394a22237124ece4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 14, 2026.

Transparency log

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

Download URL oro_sdk-6.0.0-py3-none-any.whl
Size 298.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25e2d42ed128044281bd1b519bff5136ee327e0b89747dc6c87ae9cd8f1254d1
BLAKE2b-256 checksum
How to use checksums
a1747a2ca51cbd9a5259dc323990d990e4b8c3a7576a24c56aeb4389bd0b8f7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.99

2 release files

1.0.98

2 release files

1.0.97

2 release files

1.0.96

2 release files

1.0.95

2 release files

1.0.94

2 release files

1.0.93

2 release files

1.0.90

2 release files

1.0.89

2 release files

1.0.88

2 release files

1.0.87

2 release files

1.0.86

2 release files

1.0.85

2 release files

1.0.84

2 release files

1.0.82

2 release files

1.0.81

2 release files

1.0.80

2 release files

1.0.79

2 release files

1.0.78

2 release files

1.0.77

2 release files

1.0.76

2 release files

1.0.75

2 release files

1.0.74

2 release files

1.0.73

2 release files

1.0.54

2 release files

1.0.53

2 release files

1.0.52

2 release files

1.0.51

2 release files

1.0.50

2 release files

1.0.49

2 release files

1.0.48

2 release files

1.0.47

2 release files

1.0.46

2 release files

1.0.45

2 release files

1.0.44

2 release files

1.0.43

2 release files

1.0.42

2 release files

1.0.41

2 release files

1.0.40

2 release files

1.0.39

2 release files

1.0.38

2 release files

1.0.37

2 release files

1.0.36

2 release files

1.0.35

2 release files

1.0.34

2 release files

1.0.33

2 release files

1.0.32

2 release files

1.0.31

2 release files

1.0.30

2 release files

1.0.29

2 release files

1.0.28

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

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