---
docId: doc_2c8be391516b47a284e33941fe25fe2d
title: Get the billing period
description: "Read the billing period, plan, and included credits."
api:
  group: estadisticas
  auth: bearer
  operations:
    - operationId: getUsagePeriod
      method: GET
      path: /v1/usage/period
      postmanName: Get the billing period
---

<script>
  import { Note, Ways } from '$lib/components';
</script>

# Get the billing period

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

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/usage/period \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.usage.period();
```

</Ways.Way>
</Ways>

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Workspace ID. Required when your credential covers several workspaces ([list workspaces](/api-reference/workspaces)); without it the answer is `400` | When the credential has several |

## Response

```json
{
  "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 |

```json
{
  "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](/api-reference/errors).

<Note type="note">

For enterprise workspaces, `plan.name` is `enterprise` and `plan.credits` reflects the credits configured for the workspace.

</Note>

<Note type="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.

</Note>
