Skip to main content
GET
/
compute
/
v1
/
usage
Get compute usage and billing
curl --request GET \
  --url https://api.case.dev/compute/v1/usage \
  --header 'Authorization: Bearer <token>'
{
  "period": {
    "year": 2024,
    "month": 3,
    "monthName": "March"
  },
  "summary": {
    "totalRuns": 47,
    "totalGpuHours": 12.5,
    "totalCpuHours": 3.2,
    "totalCostCents": 4750,
    "totalCostFormatted": "$47.50"
  },
  "byEnvironment": [
    {
      "environment": "legal-document-processing",
      "totalRuns": 35,
      "totalGpuSeconds": 36000,
      "totalCpuSeconds": 7200,
      "totalCostCents": 3200,
      "totalCostFormatted": "$32.00"
    },
    {
      "environment": "contract-analysis",
      "totalRuns": 12,
      "totalGpuSeconds": 9000,
      "totalCpuSeconds": 4320,
      "totalCostCents": 1550,
      "totalCostFormatted": "$15.50"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Query Parameters

year
integer

Year to filter usage data (defaults to current year)

Example:

2024

month
integer

Month to filter usage data (1-12, defaults to current month)

Required range: 1 <= x <= 12
Example:

3

Response

Usage statistics and billing information

period
object
summary
object
byEnvironment
object[]