systemr
Python SDK for agents.systemr.ai — AI-native risk intelligence for trading agents.
Install
pip install systemrQuick Start
from systemr import SystemRClient
client = SystemRClient(api_key="sr_agent_...")
# Position sizing ($0.003)
result = client.calculate_position_size(
equity="100000",
entry_price="185.50",
stop_price="180.00",
direction="long",
)
print(result["shares"], result["risk_amount"])
# Risk validation ($0.004)
risk = client.check_risk(
symbol="AAPL",
direction="long",
entry_price="185.50",
stop_price="180.00",
quantity="100",
equity="100000",
)
print(risk["approved"], risk["score"])
# Strategy evaluation ($0.10 - $1.00)
eval_result = client.basic_eval(r_multiples=["1.5", "-1.0", "2.3", "-0.5", "1.8"])
print(eval_result["g_score"], eval_result["verdict"])Get an API Key
import httpx
resp = httpx.post("https://agents.systemr.ai/v1/agents/register", json={
"owner_id": "your-id",
"agent_name": "my-trading-agent",
"agent_type": "trading",
})
data = resp.json()
print(data["api_key"]) # sr_agent_... (save this, shown only once)API Reference
Agent Management
Method | Description |
| Get agent info |
| List owner's agents |
| Change mode (sandbox/live/suspended/terminated) |
Position Sizing
Method | Cost |
| $0.003 |
Risk Validation
Method | Cost |
| $0.004 |
Evaluation
Method | Cost | Description |
| $0.10 | G metric + verdict |
| $0.50 | G + rolling G + System R Score |
| $1.00 | Full analysis + impact |
Billing
Method | Description |
| Operation prices (no auth) |
| Current USDC balance |
| Record deposit |
| Transaction history |
| Usage summary |
Error Handling
from systemr import SystemRClient, AuthenticationError, InsufficientBalanceError, SystemRError
client = SystemRClient(api_key="sr_agent_...")
try:
result = client.calculate_position_size(...)
except AuthenticationError:
print("Invalid API key or agent inactive")
except InsufficientBalanceError:
print("Deposit USDC to continue")
except SystemRError as e:
print(f"API error {e.status_code}: {e.detail}")Context Manager
with SystemRClient(api_key="sr_agent_...") as client:
result = client.check_risk(...)
# connection automatically closedMCP (Model Context Protocol)
System R is also available as an MCP server for AI assistants like Claude and ChatGPT. See the MCP documentation for configuration.
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.