Get the billing period
SDK platic.usage.period()
Read the workspace's active billing period, billing type, plan, and included credits.
Example
curl https://api.platic.ai/v1/usage/period \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.usage.period(); Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | Workspace ID. Required when your credential covers several workspaces (list workspaces); without it the answer is 400 | When 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
| Field | Description |
|---|---|
workspaceId | Workspace ID |
billingType | Billing type: trial, free, subscription, or enterprise |
plan.name | Plan name. For enterprise workspaces it is enterprise |
plan.credits | Included credits configured for the workspace |
billingPeriod | Active window used to measure consumption (startDate and endDate) |
resetDate | Date when the current period ends |
dataSince | Earliest reliable date for billable metrics |
Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | Your 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 |
401 | UNAUTHENTICATED | The credential is missing or invalid |
403 | FORBIDDEN | With an OAuth token, the person has no access to the dashboard (statistics) in that workspace. The message is Missing dashboard permission |
404 | NOT_FOUND | The 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.
Note
For enterprise workspaces, plan.name is enterprise and plan.credits reflects the credits configured for the workspace.
Tip
For subscription, the period uses Stripe currentPeriodStart/currentPeriodEnd. For trial, free, and enterprise, it uses the America/Mexico_City calendar month (UTC−6), not the server timezone.