---
title: "Get Key Spending"
method: GET
path: "/api-keys/{api_key_id}/spending"
tags: ["API Keys"]
---

# Get Key Spending

`GET /api-keys/{api_key_id}/spending`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/api-keys/{api_key_id}/spending`
- Auth: HTTP bearer

A key's caps beside what it has spent today and this month (UTC).

An Admin or Owner reads any key of the organization; any other caller reads only the key it is using, which is how
a client throttles itself. Spend is best effort: if the counter store is down the caps are still returned with a
spend of 0 rather than failing.

## Path parameters

- `api_key_id` string, required: Key id from GET /api-keys.

## Headers

- `X-Target-Org-Id` string, nullable
- `Authorization` string, nullable

## Response `200`

Successful Response

- ApiResponseApiKeySpendResponse
  - `data` ApiKeySpendResponse, required: A key's caps beside what it has spent in the current UTC day and month.
    - `api_key_id` string, required
    - `daily_credit_cap` integer, nullable
    - `monthly_credit_cap` integer, nullable
    - `spend_alert_threshold_pct` integer, nullable
    - `daily_spent` integer
    - `monthly_spent` integer
    - `daily_remaining` integer, nullable: Credits left today; null when there is no daily cap.
    - `monthly_remaining` integer, nullable: Credits left this month; null when there is no monthly cap.
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-19** `2e7cfa0ca921`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/graph8/apis/graph8-developer-api/changes/api-keys/:api_key_id/spending/get.md)

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
