orloj — Official Python SDK
Typed Python client for the Orloj v1 REST API: synchronous and asynchronous usage (httpx), Pydantic v2 models, SSE watch streams, cursor-based pagination, tasks.run(wait=True) with typed output, and a small graph-as-code authoring layer.
Requirements
- Python 3.10+
Install
uv add orloj-sdk
Then import the orloj_sdk package (from orloj_sdk import OrlojClient). pip install orloj-sdk works too.
From a git checkout:
uv sync
Configuration
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. HTTP max_retries defaults to 3 for production-friendly transient failure handling.
Quickstart
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)
Run a task and wait
from pydantic import BaseModel
from orloj_sdk import OrlojClient
class Answer(BaseModel):
summary: str
client = OrlojClient(api_token="your-token")
answer = client.tasks.run(
name="job-1",
system="demo-pipeline",
input={"query": "hello"},
wait=True,
output_type=Answer,
output_key="result",
)
print(answer.summary)
Author a system in Python
from orloj_sdk import OrlojClient
from orloj_sdk.authoring import agent, edge, node, system
@agent("researcher", model_ref="default-model")
def researcher() -> None:
"""Research the query and list key facts."""
pipeline = (
system("demo-pipeline")
.add_agent(researcher)
.set_graph({"researcher": node()})
)
pipeline.apply(OrlojClient(api_token="your-token"))
Async
from orloj_sdk import AsyncOrlojClient
async with AsyncOrlojClient(api_token="your-token") as client:
page = await client.agents.list(limit=20)
Durability
Orloj durability (leases, retries, idempotency, dead-letter) lives in the server. See docs/durability.md for guarantees, terminal phases, production server baseline, and SDK wait defaults. Temporal interop is intentionally deferred — Orloj remains the control-plane identity.
OpenAPI sync
The SDK vendors Orloj’s OpenAPI under openapi/ (see openapi/PIN.json). CI fails if:
- hand-written models lag schema properties (
scripts/check_schema_parity.py), or - generated models under
src/orloj_sdk/models/_generated/are stale (scripts/generate_models.py).
Workflow: sync from orloj → regenerate → fix parity → commit. Details in CONTRIBUTING.md.
API surface
Resource accessors on OrlojClient / AsyncOrlojClient:
| Attribute | Path prefix |
|---|---|
agents |
/v1/agents |
agent_systems |
/v1/agent-systems |
model_endpoints |
/v1/model-endpoints |
tools |
/v1/tools |
secrets |
/v1/secrets |
sealed_secrets |
/v1/sealed-secrets (+ get_public_key) |
memories |
/v1/memories |
context_adapters |
/v1/context-adapters |
eval_datasets |
/v1/eval-datasets |
eval_runs |
/v1/eval-runs (start/cancel/export/finalize/annotate/compare) |
agent_policies |
/v1/agent-policies |
agent_roles |
/v1/agent-roles |
tool_permissions |
/v1/tool-permissions |
tool_approvals |
/v1/tool-approvals |
task_approvals |
/v1/task-approvals |
tasks |
/v1/tasks (run/wait/output, logs/messages/metrics/cancel/retry/watch) |
task_schedules |
/v1/task-schedules |
task_webhooks |
/v1/task-webhooks |
workers |
/v1/workers |
mcp_servers |
/v1/mcp-servers |
auth |
auth/tokens/health/capabilities (cli_token, …) |
events |
/v1/events/watch |
a2a |
A2A registry, agent cards, JSON-RPC invoke |
Examples
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/authoring_system.py |
Graph-as-code authoring + apply |
examples/async_example.py |
AsyncOrlojClient with asyncio.gather |
export ORLOJ_API_TOKEN=...
uv run python examples/quickstart.py
Development
See CONTRIBUTING.md for setup, checks, and pull request expectations.
uv sync
uv run ruff check src/orloj_sdk tests examples
uv run ruff format src/orloj_sdk tests examples
uv run mypy src/orloj_sdk
uv run pytest --cov=orloj_sdk
License
Apache-2.0
Metadata
Release files for orloj-sdk 0.2.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 | Provenance | |
|---|---|---|---|---|
| orloj_sdk-0.2.0.tar.gz | 152.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| orloj_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 216.3 kB
Release files / orloj_sdk-0.2.0.tar.gz
| Download URL | orloj_sdk-0.2.0.tar.gz |
|---|---|
| Size | 152.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cacbdaf7992f73f823172223ddd44f43f683816cdcb8347a930015f308d785a
|
|
BLAKE2b-256 checksum How to use checksums |
e36ddc8eb56fd63b251875d7767a85106484eef0d5f9cf9b6c4f2cd6f8bc961f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / orloj_sdk-0.2.0-py3-none-any.whl
| Download URL | orloj_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 63.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b676e5c27e77fa1ca08a4cef4995c14fb6ea767a85ce6aec01e352f065fdac59
|
|
BLAKE2b-256 checksum How to use checksums |
af241c8b9c42320988d3917ad05af6b7529b175bc36c699968b5eaa311ed6184
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for orloj-sdk 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.