---
title: "Usage and spend statistics for the current user"
method: GET
path: "/api/v1/stats"
tags: ["Account Management"]
---

# Usage and spend statistics for the current user

`GET /api/v1/stats`

## Request

- Base URL: `https://api.api-stock.com`
- URL: `https://api.api-stock.com/api/v1/stats`
- Auth: HTTP bearer

## Query parameters

- `range` 'today' | '7d' | '30d' | 'custom'
- `from` string
- `to` string

## Response `200`

- StatsResponseDto
  - `from` string, required: Period start actually used (ISO 8601)
  - `to` string, required: Period end actually used (ISO 8601)
  - `totals` StatsTotalsDto, required
    - `balance` number, required: Current balance, in cents
    - `spent` number, required: Spent within the selected period, in cents. Failed generations are refunded, so they are not counted here even though they count as requests
    - `spentAllTime` number, required: Spent since registration, in cents; refunded failures excluded
    - `requests` number, required: Generations created within the period
    - `succeeded` number, required: Generations finished successfully
    - `failed` number, required: Generations that ended in an error
    - `inProgress` number, required: Generations still running
    - `llmRequests` number, required: LLM chat requests within the period
    - `llmTokens` number, required: LLM tokens consumed within the period
  - `byDay` StatsBucketDto[], required: Spend per day, ascending, gaps filled with zeroes
    - `key` string, required: Bucket key — a date (YYYY-MM-DD) or model id
    - `count` number, required: Number of generations in the bucket
    - `cost` number, required: Amount spent in the bucket, in cents; refunded failures excluded
  - `byModel` StatsBucketDto[], required: Spend per model, most expensive first
    - `key` string, required: Bucket key — a date (YYYY-MM-DD) or model id
    - `count` number, required: Number of generations in the bucket
    - `cost` number, required: Amount spent in the bucket, in cents; refunded failures excluded
  - `byType` StatsBucketDto[], required: Spend per generation type
    - `key` string, required: Bucket key — a date (YYYY-MM-DD) or model id
    - `count` number, required: Number of generations in the bucket
    - `cost` number, required: Amount spent in the bucket, in cents; refunded failures excluded

## Other responses

- `401`: Unauthorized

---

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