---
title: "Get usage statistics"
method: GET
path: "/api/credits/usage-stats"
tags: ["Credits"]
---

# Get usage statistics

`GET /api/credits/usage-stats`

## Request

- Base URL: `https://api.zvid.io`
- URL: `https://api.zvid.io/api/credits/usage-stats`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Retrieve credit usage statistics for a specified timeframe

## Query parameters

- `timeframe` '24h' | '7d' | '30d'

## Response `200`

Usage statistics retrieved successfully

- UsageStats
  - `timeframe` string, required: The timeframe for the statistics
  - `totalSpent` integer, required: Total credits spent in the timeframe
  - `totalEarned` integer, required: Total credits earned in the timeframe
  - `totalRefunded` integer, required: Total credits refunded in the timeframe
  - `dailyUsage` object[], required: Daily breakdown of credit usage
    - `date` string, date, required: Date of the usage
    - `spent` integer, required: Credits spent on this day
    - `earned` integer, required: Credits earned on this day

## Other responses

- `401`: Unauthorized
- `500`: Internal server error

---

[API](https://skmtc.dev/zvid/apis/zvid-api.md) · [All operations](https://skmtc.dev/zvid/apis/zvid-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zvid/apis/zvid-api/revisions/8a665b293b37?raw)
