Skip to content

Audit Trail

System R maintains a complete audit trail of every billable event for each agent. Every deposit, tool call, and deduction is recorded with a timestamp, operation type, amount, and resulting balance.

GET /v1/audit/trail
ParameterTypeRequiredDescription
from_datestringNoISO date start (e.g. "2026-01-01").
to_datestringNoISO date end (e.g. "2026-12-31").
limitintNoMax entries (1 to 1000, default 200).
Terminal window
curl "https://agents.systemr.ai/v1/audit/trail?from_date=2026-03-01&to_date=2026-03-31&limit=50" \
-H "X-API-Key: sr_agent_..."
{
"agent_id": "agt_a1b2c3d4",
"from_date": "2026-03-01T00:00:00",
"to_date": "2026-03-31T23:59:59",
"total_calls": 142,
"total_spend": "3.47",
"entries": [
{
"timestamp": "2026-03-25T14:30:00",
"action": "consumption",
"operation": "pre_trade_gate",
"amount": "0.01",
"balance_after": "39.03"
},
{
"timestamp": "2026-03-25T14:29:55",
"action": "consumption",
"operation": "calculate_position_size",
"amount": "0.003",
"balance_after": "39.04"
},
{
"timestamp": "2026-03-25T10:00:00",
"action": "deposit",
"operation": null,
"amount": "50.00",
"balance_after": "42.50"
}
],
"entry_count": 3
}
FieldDescription
timestampISO timestamp of the event.
actionEvent type: deposit, consumption, withdrawal, credit.
operationTool or operation name (null for deposits).
amountDollar amount of the event.
balance_afterAgent balance after this event.
GET /v1/audit/compliance-check

Runs a compliance analysis on the agent’s audit trail. Returns any flags found.

Terminal window
curl https://agents.systemr.ai/v1/audit/compliance-check \
-H "X-API-Key: sr_agent_..."
{
"agent_id": "agt_a1b2c3d4",
"is_clean": true,
"total_calls": 142,
"total_spend": "3.47",
"flags": [],
"flag_count": 0
}

If issues are detected:

{
"agent_id": "agt_a1b2c3d4",
"is_clean": false,
"total_calls": 5420,
"total_spend": "312.50",
"flags": [
{
"severity": "warning",
"description": "High call volume in short period (>1000 calls/hour)",
"timestamp": "2026-03-25T14:00:00"
}
],
"flag_count": 1
}
SeverityMeaning
infoInformational observation. No action needed.
warningUnusual pattern detected. Review recommended.
criticalPotential issue requiring immediate attention.