Skip to content

Quickstart

Terminal window
curl -X POST https://agents.systemr.ai/v1/agents/register \
-H "Content-Type: application/json" \
-d '{
"owner_id": "me",
"agent_name": "MyBot",
"agent_type": "trading"
}'

Response:

{
"agent_id": "agt_a1b2c3d4",
"agent_name": "MyBot",
"agent_type": "trading",
"mode": "sandbox",
"api_key": "sr_agent_abc123def456...",
"created_at": "2026-03-25T12:00:00Z"
}

Save the api_key. It is shown once and cannot be retrieved later.

Terminal window
pip install systemr

Requires Python 3.9 or higher.

from systemr import SystemRClient
client = SystemRClient(api_key="sr_agent_...")
gate = client.pre_trade_gate(
symbol="AAPL",
direction="long",
entry_price="185.50",
stop_price="180.00",
equity="100000",
)
print(f"Gate passed: {gate['gate_passed']}")
print(f"Shares: {gate['sizing']['shares']}")
print(f"Risk amount: ${gate['sizing']['risk_amount']}")

This single call runs position sizing (G-formula), risk validation (Iron Fist rules), and system health assessment. Cost: $0.01.

  1. The SDK sent POST /v1/compound/pre-trade-gate with your parameters.
  2. System R sized the position using the G-formula (geometric growth optimization).
  3. Iron Fist risk rules validated the trade against position risk, portfolio risk, and daily loss limits.
  4. $0.01 was deducted from your compute credit balance.
  5. You received a complete pre-trade report in one response.