SecureAgentMail

Credit consumption history

Returns a paginated ledger of individual credit consumption events. Each entry records the amount consumed, the reason, and the resulting balance.

GET
/credits/ledger

Authorization

BearerAuth
AuthorizationBearer <token>

API key passed as a Bearer token. Production keys start with am_live_ and sandbox keys start with am_test_.

In: header

Query Parameters

since?string

Only return entries created at or after this ISO 8601 timestamp.

Formatdate-time
reason?string

Filter entries by consumption reason.

Value in"message_received" | "message_sent" | "ai_scan" | "pii_redaction" | "hitl_review"
limit?integer

Maximum number of items to return per page.

Default25
Range1 <= value <= 100
cursor?string

Opaque pagination cursor returned as next_cursor from a previous request.

Response Body

application/json

application/json

application/json

curl -X GET "https://secureagentmail.com/api/v1/credits/ledger"
{
  "entries": [
    {
      "id": "crd_w5x1y6",
      "amount": 10,
      "reason": "ai_scan",
      "resource_id": "msg_x7k9m2",
      "balance_after": 5790,
      "created_at": "2026-02-25T10:15:30Z"
    }
  ],
  "has_more": true,
  "next_cursor": "string"
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key.",
    "status": 401
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Please retry after 30 seconds.",
    "status": 429
  }
}