Daily & Total Caps

Daily & Total Caps

Configure per-agent spending ceilings and rolling-window limits.

Runtime

Daily cap

The dailyCap / daily_cap resets at midnight UTC. It is the most common limit used in production deployments because it naturally aligns with API billing cycles.

typescriptnomiqon.com
const agent = await nomiqon.agents.create({
  name: "daily-capped-agent",
  policy: {
    dailyCap: "15.00",   // agent cannot spend more than $15 USDC per day
  },
});

Total (lifetime) cap

totalCap / total_cap is a hard ceiling over the agent's entire lifetime. Once reached, the agent is permanently suspended unless you create a new agent or issue a cap extension.

typescriptnomiqon.com
policy: {
  dailyCap: "10.00",
  totalCap: "500.00",   // agent terminates after spending $500 USDC total
}

Rolling window cap

The windowCap / window_cap enforces a sliding-window ceiling independent of the calendar day. Useful for rate-sensitive APIs or burst protection.

typescriptnomiqon.com
policy: {
  dailyCap: "10.00",
  windowCap: {
    amount:   "2.00",      // max $2 USDC per hour
    windowMs: 3_600_000,   // 1 hour in ms
  },
}

Cap enforcement example JSON

jsonnomiqon.com
{
  "id": "pol_01jx9z3w...",
  "agentId": "ag_01jx5k8r...",
  "version": 3,
  "dailyCap": "10.00",
  "totalCap": "500.00",
  "windowCap": { "amount": "2.00", "windowMs": 3600000 },
  "allowlist": ["api.openai.com", "api.anthropic.com"],
  "frozen": false,
  "createdAt": "2026-05-24T00:00:00.000Z",
  "_computed": {
    "spentToday":    "3.47",
    "spentTotal":    "124.09",
    "spentInWindow": "0.82",
    "remainingToday": "6.53",
    "remainingTotal": "375.91"
  }
}
Warning
Cap computations are based on committed amounts including pending transactions. A transaction stuck in the pending state still counts against the cap until it settles or expires (default TTL: 60 s).
Daily & Total Caps — Nomiqon Docs