Yapper API
Api reference
GET
/usage/sessions

Sessions with their all-time credit spend, runs and top model. Matches the Sessions card on the account usage page. sort is spend (default, by gross credits spent), runs, or newest. Any key may read session totals. memberId returns only that member's sessions and their share; another member's requires the key's member to be a team owner or admin, and only those keys receive contributors. A deleted session keeps its spend and is returned with deleted: true. Returns usage_breakdown_unavailable (409) until the workspace's usage history has been indexed.

Authorization

bearerAuth usage:read
AuthorizationBearer <token>

In: header

Scope: usage:read

Query Parameters

sort?string
Default"spend"

Value in

  • "spend"
  • "runs"
  • "newest"
memberId?string
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

application/json

curl -X GET "https://example.com/usage/sessions"
{  "data": [    {      "sessionId": "string",      "title": "string",      "deleted": true,      "createdAt": "2019-08-24T14:15:22Z",      "credits": 0,      "creditsSpent": 0,      "creditsRefunded": 0,      "runs": 0,      "topModel": {        "id": "string",        "label": "string"      },      "contributors": [        {          "userId": "string",          "credits": 0,          "runs": 0        }      ]    }  ],  "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"  }}
{  "error": {    "code": "string",    "message": "string",    "requestId": "string"  }}