---
title: "Get usage statistics for an API key"
method: GET
path: "/keys/{keyId}/usage"
tags: ["API Key Management"]
---

# Get usage statistics for an API key

`GET /keys/{keyId}/usage`

## Request

- Base URL: `https://api.rateapi.dev`
- URL: `https://api.rateapi.dev/keys/{keyId}/usage`
- Auth: API key in header `X-API-Key`

Returns usage statistics including requests made, remaining quota, tier information, and recent request history. You can only view usage for your own API key.

**Authentication required**: Pass your API key in the `X-API-Key` header.

## Path parameters

- `keyId` string, required

## Response `200`

Usage statistics retrieved successfully

- UsageResponse: Current quota state for the calling API key, plus its most recent requests.
  - `keyId` string, required: The API key ID
  - `tier` object, required: Current tier information for this key
    - `level` 1 | 2 | 3, required: Tier level: 1 = Free, 2 = Pro, 3 = Enterprise.
    - `name` 'Free' | 'Pro' | 'Enterprise', required: Human-readable tier name
  - `usage` UsageInfo, required: Requests consumed and remaining against the key’s quota for the current window.
    - `used` integer: Requests used in the current window. Absent for an Enterprise organization, which has no quota to count against.
    - `remaining` union: Requests still available in the current window.
      - integer: Requests remaining in current window
      - 'unlimited': Returned as the literal string `unlimited` for an Enterprise organization, whose plan carries no request quota.
    - `limit` union: Total requests the key’s tier allows per window.
      - integer: Maximum requests allowed per window
      - 'unlimited': Returned as the literal string `unlimited` for an Enterprise organization, whose plan carries no request quota.
    - `windowDays` integer, required: Rate limit window in days (always 30)
    - `resetAt` string, date-time: ISO 8601 timestamp when the rate limit window resets. Absent for an Enterprise organization, which has no window.
    - `scope` 'key' | 'organization': Whether the quota is counted per key or pooled across the organization the key belongs to.
  - `recentRequests` object[], required: Last 10 requests made with this key, ordered by most recent first
    - `endpoint` string, required: API endpoint that was called
    - `timestamp` string, date-time, required: ISO 8601 timestamp when the request was made
  - `organizationId` string: Organization the key belongs to. Present only for a key connected to an organization; the quota is then pooled across that organization.

## Other responses

- `401`: Missing or invalid API key
- `403`: Not authorized to view this key's usage
- `429`: Rate limit exceeded
- `500`: Internal server error

---

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