---
title: "Get User Usage Summary"
method: GET
path: "/api/v1/usage-stats/user-summary"
tags: ["usage-stats"]
---

# Get User Usage Summary

`GET /api/v1/usage-stats/user-summary`

Get comprehensive usage statistics summary for the current user.

Args:
    include_inactive: Whether to include inactive API keys in the summary
    
Returns:
    Complete usage statistics summary for the user

## Query parameters

- `include_inactive` boolean

## Response `200`

Successful Response

- UserUsageStatsSummary — User's overall usage statistics summary.
  - `user_id` integer, required — User ID
  - `total_api_keys` integer, required — Total number of API keys
  - `active_api_keys` integer, required — Number of active API keys
  - `current_tokens_all_keys` integer — Current window tokens across all keys
  - `current_requests_all_keys` integer — Current window requests across all keys
  - `current_cost_all_keys` number — Current daily cost across all keys
  - `formatted_current_cost` string — Formatted current daily cost
  - `total_tokens_all_keys` integer — Total tokens across all keys
  - `total_requests_all_keys` integer — Total requests across all keys
  - `total_cost_all_keys` number — Total cost across all keys
  - `formatted_total_cost` string — Formatted total cost
  - `api_key_stats` DashboardUsageStats[], required — Individual API key statistics
    - `api_key_id` integer, required — Local API key ID
    - `api_key_name` string, required — API key name
    - `external_id` string, nullable, required — External API key ID
    - `is_active` boolean, required — Whether API key is active
    - `expires_at` string, nullable — Expiration timestamp from API
    - `expires_at_display` string — Formatted expiration time for display
    - `current_tokens` integer — Current window tokens used
    - `current_requests` integer — Current window requests made
    - `current_daily_cost` number — Current daily cost
    - `formatted_current_cost` string — Formatted current daily cost
    - `current_window_tokens` integer — Current rate limit window tokens
    - `current_window_requests` integer — Current rate limit window requests
    - `current_window_cost` number — Current rate limit window cost
    - `total_tokens` integer — Total tokens used
    - `total_requests` integer — Total requests made
    - `total_cost` number — Total cost
    - `formatted_cost` string — Formatted total cost
    - `daily_cost_limit` number — Daily cost limit
    - `token_limit` integer — Token limit
    - `has_daily_limit` boolean — Whether this key has daily limits
    - `rate_limit_window` integer — Rate limit window in minutes
    - `rate_limit_requests` integer — Rate limit requests per window
    - `rate_limit_cost` number — Rate limit cost per window
    - `opus_weekly_cost` number — Opus model cost this week
    - `opus_weekly_limit` number — Opus model weekly limit
    - `opus_weekly_percentage` number — Opus weekly usage percentage
    - `has_monthly_quota` boolean — Whether this key has a monthly/lifetime cost cap
    - `monthly_cost_limit` number — Monthly cost limit in USD (CRS totalCostLimit)
    - `monthly_cost_used` number — Amount of monthly cost used
    - `monthly_cost_percentage` number — Percentage of monthly cost limit used
    - `window_remaining_seconds` integer — Seconds until window reset
    - `window_remaining_text` string — Human readable time until reset
    - `daily_cost_percentage` number — Percentage of daily cost limit used
    - `token_percentage` number — Percentage of token limit used
    - `window_requests_percentage` number — Percentage of window requests used
    - `window_cost_percentage` number — Percentage of window cost used
    - `is_near_cost_limit` boolean — Whether near daily cost limit
    - `is_near_token_limit` boolean — Whether near token limit
    - `is_near_window_limit` boolean — Whether near window limit
    - `is_near_opus_limit` boolean — Whether near Opus weekly limit
    - `has_error` boolean — Whether there was an error fetching stats
    - `error_message` string, nullable — Error message if any
    - `error_type` string, nullable — Error type for better handling
    - `daily_model_stats` ModelDailyStats[] — Today's model usage breakdown
      - `model` string, required — Model name
      - `requests` integer, required — Number of requests today
      - `inputTokens` integer, required — Input tokens used
      - `outputTokens` integer, required — Output tokens used
      - `cacheCreateTokens` integer, required — Cache creation tokens
      - `cacheReadTokens` integer, required — Cache read tokens
      - `allTokens` integer, required — Total tokens
      - `total_cost` number — Total cost for this model today
      - `formatted_cost` string — Formatted cost string
  - `last_updated` string, date-time, required — Last update timestamp
  - `last_updated_beijing` string — Last update time in Beijing timezone
  - `has_any_errors` boolean — Whether any keys had errors

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/qcode/apis/qcode-web.md) · [All operations](https://skmtc.dev/qcode/apis/qcode-web/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qcode/qcode-web/revisions/2f2f5f49ffc7/schema)
