Documentation
How the gate works
Everything a developer needs to understand, integrate, and trust Aegis.
How it works
Step 1
Register your agent
Give your agent a name and receive an API key instantly. No email, no setup call — the key is generated in your browser session and shown exactly once.
Step 2
Call the gate before every transaction
One POST request, authenticated with your key. Aegis compares the amount against the live policy limit.
curl -X POST https://aegis-agent-4u79.onrender.com/api/audit \
-H "Authorization: Bearer agk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 4500, "currency": "KES"}'
Step 3
Act only on APPROVED
The verdict, reason and toll come back in milliseconds, and the decision is written to the immutable audit trail. Anything else — block by default.
{
"status": "APPROVED",
"tollKES": 0.5,
"auditId": "6ad9…",
"mode": "live"
}
API Reference
| Endpoint | Auth | What it does |
|---|---|---|
| POST /api/agents/register | none | Issue an agent ID + API key (shown once) |
| POST /api/audit | bearer (optional) | The audit gate — APPROVED / BLOCKED verdict |
| GET /api/agents/me | bearer | Your agent's usage counters |
| GET /api/audit/recent | none | Last 15 verdicts from the immutable trail |
| GET /api/network/stats | none | Live public network telemetry |
| GET /api/config | none | Current policy limits (KES ceiling, toll, FX) |
cURL
curl -X POST https://aegis-agent-4u79.onrender.com/api/audit \
-H "Authorization: Bearer agk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 4500, "currency": "KES"}'
Node.js
const res = await fetch(
"https://aegis-agent-4u79.onrender.com/api/audit",
{ method: "POST",
headers: {
Authorization: "Bearer " + process.env.AEGIS_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 4500, currency: "KES",
}),
});
const verdict = await res.json();
if (verdict.status !== "APPROVED") throw new Error(verdict.reason);
Python
import os, requests
verdict = requests.post(
"https://aegis-agent-4u79.onrender.com/api/audit",
headers={"Authorization": f"Bearer {os.environ['AEGIS_KEY']}"},
json={"amount": 4500, "currency": "KES"},
).json()
if verdict["status"] != "APPROVED":
raise RuntimeError(verdict["reason"])
Found a gap in these docs, or something crashing? Tell the team — issues get a response within 48 hours.