---
title: "Usage vs plan limits for the current billing period (billing:read or projects:read)"
method: GET
path: "/billing/usage"
tags: ["Billing"]
---

# Usage vs plan limits for the current billing period (billing:read or projects:read)

`GET /billing/usage`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/billing/usage`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `orgId` string: Organization id (required when you belong to several)
- `lang` 'en' | 'sv': Language of labels and Stripe pages (default en)

## Response `200`

Usage

- object
  - `organizationId` string, uuid, required
  - `planId` 'free' | 'pro' | 'business', required
  - `period` object, required
    - `start` string, required: ISO-8601 timestamp
    - `end` string, required: ISO-8601 timestamp
    - `source` 'subscription' | 'calendar_month', required
  - `metrics` object[], required
    - `metric` 'projects' | 'databases' | 'seats' | 'buildMinutes' | 'bandwidthGb' | 'storageGb' | 'aiCredits' | 'emailsPerDay' | 'emailsPerMonth', required
    - `unit` 'count' | 'minutes' | 'gb' | 'credits', required
    - `label` string, required
    - `measured` boolean, required: false: no data source yet ("not metered yet"); used is then null
    - `used` number, nullable, required
    - `limit` number, nullable, required: included amount or allowance; null = unlimited
    - `cap` number, nullable, required: hard cap the team set (build minutes); null = none
    - `enforcedAt` 'create' | 'deploy' | 'builder' | 'send' | 'none', required: send: transactional email, refused with rate_limited once the quota is used (emailsPerDay resets 00:00 UTC, emailsPerMonth with the period)
    - `percent` number, nullable, required: used / limit in percent (rounded), null when unlimited or unmeasured
    - `state` 'ok' | 'warning' | 'reached' | 'over', required: warning ≥ 80%, reached ≥ 100%, over: beyond the included amount and billed
    - `overage` object, nullable, required
      - `quantity` number, required
      - `unitAmountDecimal` string, required
      - `currency` string, required
      - `estimatedAmount` integer, required: minor units (cents)
  - `credits` object, required
    - `renewal` 'monthly' | 'once', required
    - `allowance` number, required: credits included by the plan (per period, or once on Free)
    - `allowanceUsed` number, required
    - `allowanceRemaining` number, required
    - `purchased` number, required: remaining purchased or granted credits; they never expire. Negative = a debt from a refunded or disputed top-up that was already spent, repaid by the next purchase
    - `remaining` number, required: allowanceRemaining + purchased (a negative purchased balance counts as 0: a debt never reduces the allowance)
    - `usedThisPeriod` number, required
  - `alerts` object[], required: 80%/100% warnings raised in the current period
    - `metric` 'projects' | 'databases' | 'seats' | 'buildMinutes' | 'bandwidthGb' | 'storageGb' | 'aiCredits' | 'emailsPerDay' | 'emailsPerMonth', required
    - `threshold` union, required
      - 80
      - 100
    - `createdAt` string, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden); details.requiresSession for plan/payment changes over a token
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state, e.g. a subscription already exists (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Billing is not set up on this server (code not_configured)
- `503`: The payment provider is unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
