Atomic check + increment. Idempotent on (sub, metric, clientReqId).
POST/me/agents/:agentId/usage/:metricSlug/consume
Agent backends call this BEFORE running the chargeable action. Returns 429 with code: QUOTA_EXCEEDED when the increment would breach the effective quota (base + addons). 402 when there is no active subscription. 404 when the metric slug is unknown.
Request
Responses
- 200
- 402
- 429
code: PAYMENT_REQUIRED
code: QUOTA_EXCEEDED; details include used, effectiveQuota, remaining, resetsAt