---
title: "Get a key's recent usage"
method: GET
path: "/api/keys/{id}/usage"
tags: ["API Keys"]
---

# Get a key's recent usage

`GET /api/keys/{id}/usage`

## Request

- Base URL: `https://www.audioscrape.com`
- URL: `https://www.audioscrape.com/api/keys/{id}/usage`
- Auth: HTTP bearer

Returns how many requests authenticated with this key over the trailing 30 days. Pair with `last_used` / `last_used_ip` from the list endpoint to audit a credential before revoking or rotating it.

Accepts either a session cookie or an existing API key as auth.

## Path parameters

- `id` integer, required

## Response `200`

Usage over the trailing 30-day window

- ApiKeyUsage
  - `key_id` integer, required
  - `requests` integer, required: Requests that authenticated with this key inside the window.
  - `window_days` integer, required: Trailing window the count covers, in days.

## Other responses

- `401`: Missing or invalid session / key
- `404`: No key with this id belongs to you

---

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