---
title: "Retrieve an API key's usage"
description: "One key's last 24 hours: how many requests it made, how many were answered 4xx, 5xx or 429, and when it was last used. `GET /api/v1/api-keys/{id}/usage`"
url: https://www.unitpost.com/docs/platform/get-api-keys-id-usage
section: "Platform API reference"
updated: 2026-10-13
---
# Retrieve an API key's usage

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

One key's last 24 hours: how many requests it made, how many were answered 4xx, 5xx or 429, and when it was last used. Check it before you revoke a key (is anything still calling with it?) or when an integration's calls fail. The dashboard's revoke dialog reads the same count. Needs `apikeys:read`, which no key preset includes. Requires the `apikeys:read` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | The key (`key_…`). |
| `last_used_at` | string \| null | yes | — |
| `requests_24h` | integer | yes | Requests the key made in the last 24 hours, counted up to 100,000: `100001` means more than 100,000. |
| `client_errors_24h` | integer | yes | Of those, answered 4xx (`rate_limited_24h` included). Past the cap, these three count the latest 100,001 requests. |
| `server_errors_24h` | integer | yes | Of those, answered 5xx. |
| `rate_limited_24h` | integer | yes | Of those, answered 429. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The key's usage. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | API key not found. |
| 422 | An unknown query parameter. |
| 503 | `operation_timed_out`: a very busy key's count took too long; retry. |

## Example request

```bash
curl -X GET 'https://www.unitpost.com/api/v1/api-keys/key_123/usage' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Example response (200)

```json
{
  "object": "api_key_usage",
  "id": "id_123",
  "last_used_at": "2026-01-01T00:00:00.000Z",
  "requests_24h": 0,
  "client_errors_24h": 0,
  "server_errors_24h": 0,
  "rate_limited_24h": 1
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/get-api-keys-id-usage
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
