---
title: "Retrieve the daily usage of an API key"
method: GET
path: "/accounts/{account}/api-keys/{api_key}/usage"
tags: ["Account"]
---

# Retrieve the daily usage of an API key

`GET /accounts/{account}/api-keys/{api_key}/usage`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/accounts/{account}/api-keys/{api_key}/usage`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Retrieve the daily usage of an API key over the last `days` days (7, 30 or 90; default 30).
- `daily` lists requests, successes, 4xx, 429 and 5xx per day, oldest first; `total` sums them.
- `last_used_at`/`last_used_ip` are `null` if never used. Requires `account:read`.
- Unknown key returns 404 `api_key_not_found`; other `days` returns 422.

## Path parameters

- `account` string, uuid, required
- `api_key` string, uuid, required

## Query parameters

- `days` 7 | 30 | 90

## Headers

- `Factuarea-Version` string, date

## Response `200`

- object
  - `data` ApiKeyUsage, required: Daily usage of one API key of your account over the last 7, 30 (default) or 90 days. It is an AGGREGATE, not an entity: it carries no `id`. Only counters — it never exposes quota, tier limits or prices.
    - `daily` object[], required: One item per day of the period, oldest first. Days without requests appear with every counter at 0.
      - `date` string, date, required: Day (ISO 8601 date).
      - `requests_count` integer, required: Requests made with the key.
      - `successful_count` integer, required: Requests answered with a 2xx or 3xx status.
      - `client_error_count` integer, required: Requests answered with a 4xx status other than 429.
      - `rate_limited_count` integer, required: Requests answered with 429.
      - `error_count` integer, required: Requests answered with a 5xx status.
    - `total` object, required: Sum of the counters of the period.
      - `requests_count` integer, required: Requests made with the key.
      - `successful_count` integer, required: Requests answered with a 2xx or 3xx status.
      - `client_error_count` integer, required: Requests answered with a 4xx status other than 429.
      - `rate_limited_count` integer, required: Requests answered with 429.
      - `error_count` integer, required: Requests answered with a 5xx status.
    - `last_used_at` string, date-time, nullable, required: Instant of the last authenticated request with the key, or `null` if it was never used.
    - `last_used_ip` string, nullable, required: IP address of that last request, or `null` if the key was never used.

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company.
- `422`: Validation failed — e.g. the API key plan limit was reached, or an invoice language outside the allowed catalog (`es`, `en`, `ca`). The `error.param` field identifies which input is invalid, if any.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

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