Requirements
- Python 3.11+
- A Regent account with an API key (
rgnt_…); a sandbox organization needs no identity verification
Install
The SDK is not on PyPI yet, and the PyPI names regent and regent-sdk belong to unrelated projects: do not pip install regent. Install from the public GitHub repository, pinned to a commit so a rebuild gets the same code; a floating branch is not a dependency.
pip install "git+https://github.com/abay94/regent-sdk-python.git@2066a1ae93b0"The REST API needs no SDK: the Quick Start decides a payment with plain curl and fetch as well.
For local development from a checkout:
git clone git@github.com:abay94/regent-sdk-python.git
cd regent-sdk-python
pip install -e .Verify
python -c "import regent; print('regent SDK import OK')"
pip show regent-sdk # Name: regent-sdk, Version: 0.1.0Optional extras
For the included examples (Binance trading agent, etc.) you may also want:
pip install httpx pydantic richhttpxis a hard dependency of the SDK — installed automatically.pydanticis a hard dependency — installed automatically.richis optional but recommended for the demo Binance agent’s terminal UI.
Async runtime
The SDK is async-only; there is no synchronous wrapper. A script wraps its work in one asyncio.run(...):
import asyncio
from regent import RegentClient
async def main():
async with RegentClient(base_url="https://api.regentprotocol.org", api_key="rgnt_...") as r:
print(await r.identity.get_agent("agent_b1c59d23..."))
asyncio.run(main())Inside an existing event loop (a web server, a notebook) await the calls directly. In Jupyter, asyncio.run collides with the notebook’s loop: use top-level await, or nest_asyncio.
# Jupyter / IPython
import nest_asyncio; nest_asyncio.apply()
from regent import RegentClient
async with RegentClient(...) as r:
agent = await r.identity.get_agent("agent_b1c59d23...")
print(agent)What next
Configure the base URL and API key — and understand how org scoping works.
Authentication