Get the billing period

SDK platic.usage.period()

Read the workspace's active billing period, billing type, plan, and included credits.

Example

await platic.usage.period();

Query parameters

ParameterTypeDescriptionRequired
workspacestringWorkspace ID. Required when your credential covers several workspaces (list workspaces); without it the answer is 400When the credential has several

Response

{
  "status": "success",
  "data": {
    "workspaceId": "g6yCA16pkWl5eXo7KszB",
    "billingType": "subscription",
    "plan": {
      "name": "Growth",
      "credits": 6500
    },
    "billingPeriod": {
      "startDate": "2026-06-01T00:00:00.000Z",
      "endDate": "2026-06-30T23:59:59.999Z"
    },
    "resetDate": "2026-06-30T23:59:59.999Z",
    "dataSince": "2026-05-21T06:00:00.000Z"
  }
}

Response fields

FieldDescription
workspaceIdWorkspace ID
billingTypeBilling type: trial, free, subscription, or enterprise
plan.namePlan name. For enterprise workspaces it is enterprise
plan.creditsIncluded credits configured for the workspace
billingPeriodActive window used to measure consumption (startDate and endDate)
resetDateDate when the current period ends
dataSinceEarliest reliable date for billable metrics

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the IDs you can use and details.requested the one you sent
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENWith an OAuth token, the person has no access to the dashboard (statistics) in that workspace. The message is Missing dashboard permission
404NOT_FOUNDThe workspace no longer exists. This is rare
{
  "code": 400,
  "error": "Bad Request - The request has validation errors",
  "details": {
    "code": "INVALID_REQUEST",
    "message": "Must specify a valid workspace (multi-workspace credential)",
    "available": ["g6yCA16pkWl5eXo7KszB", "Hk29fQm1ZpXr7aLwT0sd"]
  }
}

The general error format is in Errors.