Skip to main content
GET
/
v1
/
usage
/
report
Get Usage Report
curl --request GET \
  --url https://api.swarms.world/v1/usage/report \
  --header 'x-api-key: <x-api-key>'
{
  "results": [
    {
      "day": "<string>",
      "total_cost": 123,
      "input_tokens": 123,
      "output_tokens": 123,
      "request_count": 123
    }
  ],
  "period": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "timestamp": "<string>"
}

Headers

x-api-key
string
required

Query Parameters

period
string | null
default:month

Predefined period: 'day', 'week', or 'month'.

start_date
string<date> | null

Custom start date (YYYY-MM-DD). Overrides period when both start_date and end_date are provided.

end_date
string<date> | null

Custom end date (YYYY-MM-DD). Overrides period when both start_date and end_date are provided.

Response

Successful Response

results
UsageReportDay · object[]
required

Daily usage breakdown for the requested period.

period
string
required

The period that was queried (day, week, month, or custom).

start_date
string
required

Start date of the report (YYYY-MM-DD).

end_date
string
required

End date of the report (YYYY-MM-DD).

timestamp
string
required

ISO timestamp when the report was generated.