Skip to main content
GET
/
database
/
v1
/
usage
Get database usage and billing
curl --request GET \
  --url https://api.case.dev/database/v1/usage \
  --header 'Authorization: Bearer <token>'
{
  "period": {
    "start": "2024-03-01T00:00:00.000Z",
    "end": "2024-03-31T23:59:59.999Z"
  },
  "pricing": {
    "computePerCuHour": 0.102,
    "storagePerGbMonth": 0.024,
    "transferPerGb": 0.09,
    "branchPerMonth": 0,
    "freeBranches": 10
  },
  "totals": {
    "computeCuHours": 45.2,
    "storageGbMonths": 12.5,
    "transferGb": 3.2,
    "totalBranches": 8,
    "computeCostDollars": "4.61",
    "storageCostDollars": "0.30",
    "transferCostDollars": "0.29",
    "branchCostDollars": "0.00",
    "totalCostDollars": "5.20"
  },
  "projects": [
    {
      "id": "usage_abc123",
      "projectId": "proj_xyz789",
      "projectName": "legal-documents-db",
      "computeCuHours": 30.5,
      "storageGbMonths": 8.2,
      "transferGb": 2.1,
      "branchCount": 5,
      "costs": {
        "compute": "3.11",
        "storage": "0.20",
        "transfer": "0.19",
        "branches": "0.00",
        "total": "3.50"
      },
      "lastUpdated": "2024-03-15T10:30:00Z"
    }
  ],
  "projectCount": 1
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Response

Database usage statistics and billing information

period
object
pricing
object

Current pricing rates

totals
object

Aggregated totals across all projects

projects
object[]

Usage breakdown by project

projectCount
integer

Total number of projects with usage