Skip to main content
GET
/
user
/
usage
/
history
Get user usage history
curl --request GET \
  --url https://api.datalinks.com/api/v1/user/usage/history \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "timestamp": "2021-01-01T12:12:12.000Z",
      "tokensUsed": 1241,
      "costUSD": 0.0001
    }
  ],
  "meta": {
    "pageSize": 100,
    "pageCursor": {
      "lastStartTime": "2021-01-01T12:12:12.000Z",
      "lastObservationId": "obs_12345"
    }
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token for authentication. Submit the token using the Authorization header: Authorization: Bearer <token>.

Query Parameters

onOrAfter
string<date-time>

Return records on or after this timestamp.

Example:

"2021-01-01T00:00:00.000Z"

before
string<date-time>

Return records before this timestamp.

Example:

"2021-12-31T23:59:59.999Z"

pageSize
integer
default:25

Maximum number of results to return.

Required range: 1 <= x <= 100

Response

Returns usage history.

data
object[]
required
meta
object
required