First API Call
Walk through your first tool call, understand the response, and see how billing works.
The pre_trade_gate
The best first call is pre_trade_gate. It combines position sizing, risk validation, and optional system health inputs into one structured response.
Reading the response
Field breakdown
Top level:
| Field | Type | Description |
|---|---|---|
gate_passed | bool | true if both sizing and risk check succeeded. |
sizing | object | Position sizing result from the G-formula. |
risk | object | Iron Fist risk validation result. |
system_health | object or null | System health check. Present only if you pass r_multiples. |
Sizing:
| Field | Type | Description |
|---|---|---|
shares | int | Number of shares to buy. |
risk_amount | string | Dollar amount at risk. |
risk_percent | string | Risk as a fraction of equity (0.02 = 2%). |
notional | string | Total position value in dollars. |
one_r_dollars | string | Dollar value of one R-unit. |
direction | string | Trade direction (long or short). |
Risk:
| Field | Type | Description |
|---|---|---|
approved | bool | true if the trade passes all risk rules. |
score | int | Risk score from 0 (worst) to 100 (best). |
errors | string[] | Blocking issues that prevented approval. |
warnings | string[] | Non-blocking concerns. |
Adding system health
Pass your recent R-multiples to include a system health check:
How billing works
System R AI uses usage-based credits for paid workflows. Billing can depend on the operation, provider path, and current metering rules. Use the live pricing endpoint as the source of truth before production use.
For paid operations:
- System R checks your balance before executing the operation.
- If the balance is sufficient, the call executes and the cost is deducted.
- If the balance is insufficient, you receive a 402 error. No charge.
Check your balance:
The is_low flag reflects the current account threshold returned by the billing service.
Using the generic tool call
Every tool can be called through the universal endpoint:
The generic call_tool method maps to POST /v1/tools/call:
Next calls to try
| Tool | What it does |
|---|---|
calculate_position_size | Position sizing from account, entry, stop, direction, and risk inputs. |
check_trade_risk | Pre-trade risk validation from supplied trade details. |
evaluate_performance | Performance diagnostics from R-multiples. |
run_monte_carlo | Simulate possible equity paths from supplied assumptions. |
assess_trading_system | System diagnostics from supplied performance data. |
See the tools reference and live discovery output for current tools, schemas, and pricing.
| Python SDK | pip install systemr |
| MCP Server | agents.systemr.ai/mcp/sse |
| OpenAPI Spec | agents.systemr.ai/v1/openapi.json |
| Machine Docs | agents.systemr.ai/llms.txt |
| GitHub | System-R-AI |
| X | @Systemrai |
| YouTube | @systemr_ai |
| hello@systemr.ai | |
| Phone | 628 333 6693 |
| Address | 7901 4TH ST N, STE 28529, ST PETERSBURG, FL 33702 |
| Terms | Terms of Service |
| Privacy | Privacy Policy |
| Security | Security Policy |