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 responsesync_detailed()- Blocking request returning full Response objectasyncio()- Async request returning parsed responseasyncio_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)
| File | Size | Uploaded | |
|---|---|---|---|
| oro_sdk-6.0.0.tar.gz | 137.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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