Typed Python client for the Orloj v1 REST API: synchronous and asynchronous usage (httpx), Pydantic v2 models, SSE watch streams, and cursor-based pagination.
- Python 3.10+
From PyPI:
pip install orloj-sdkInstall with pip install orloj-sdk, then import the orloj_sdk package (from orloj_sdk import OrlojClient).
From a git checkout:
pip install -e ".[dev]"The client reads defaults from the environment (same order as orlojctl):
| Setting | Constructor | Environment (first wins) |
|---|---|---|
| API token | api_token= |
ORLOJCTL_API_TOKEN, ORLOJ_API_TOKEN |
| Base URL | base_url= |
ORLOJCTL_SERVER, ORLOJ_SERVER |
If unset, the base URL defaults to http://127.0.0.1:8080 and the namespace defaults to default.
from orloj_sdk import OrlojClient
client = OrlojClient(api_token="your-token")
who = client.auth.whoami()
print(who.authenticated, who.username)
for agent in client.agents.list_all():
print(agent.metadata.name)from orloj_sdk import AsyncOrlojClient
async with AsyncOrlojClient(api_token="your-token") as client:
page = await client.agents.list(limit=20)Runnable scripts (require a running Orloj API):
| Script | Description |
|---|---|
examples/quickstart.py |
whoami and list agents |
examples/watch_tasks.py |
SSE watch on a task until completion |
examples/multi_agent_system.py |
Create an AgentSystem with a graph |
examples/async_example.py |
AsyncOrlojClient with asyncio.gather |
export ORLOJ_API_TOKEN=...
python examples/quickstart.pySee CONTRIBUTING.md for setup, checks, and pull request expectations.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
ruff check src/orloj_sdk tests examples
ruff format src/orloj_sdk tests examples
mypy src/orloj_sdk
pytest --cov=orloj_sdkApache-2.0