Yapper API
Api reference
GET
/usage/ledger

Individual credit charges and refunds, newest first. Matches the credit log on the account usage page. The window is range (default month, the same UTC buckets as GET /usage/breakdown) or createdAfter/createdBefore; combining the two returns unsupported_filter_combination. Entries name the member who spent, so listing other members' entries requires the key's member to be a team owner or admin; anyone else passes their own user id (actor.userId from GET /me) as memberIds. source narrows to API-key (api) or hosted-connector (mcp) spend; because the source is derived per entry, a page can then hold fewer than limit entries while nextCursor is still set. For totals over the same filters use GET /usage/breakdown.

Authorization

bearerAuth usage:read
AuthorizationBearer <token>

In: header

Scope: usage:read

Query Parameters

range?string
Default"month"

Value in

  • "week"
  • "month"
  • "quarter"
  • "year"
  • "all"
createdAfter?string
Formatdate-time
createdBefore?string
Formatdate-time
memberIds?string

Comma-separated user ids (up to 30).

sessionId?string

Only items in this session.

source?string

Value in

  • "api"
  • "mcp"
limit?integer
Range1 <= value <= 100
Default20
cursor?string

Opaque pagination cursor — pass the nextCursor from the previous page verbatim. nextCursor is null on the last page.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/usage/ledger"
{  "data": [    {      "id": "string",      "createdAt": "2019-08-24T14:15:22Z",      "type": "charge",      "credits": 0,      "adjustment": true,      "userId": "string",      "model": {        "id": "string",        "label": "string"      },      "processType": "string",      "processId": "string",      "sessionId": "string",      "source": "web",      "description": "string"    }  ],  "nextCursor": "string"}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}