---
title: "Account-wide usage across sessions and API keys [read]"
method: GET
path: "/billing/usage"
---

# Account-wide usage across sessions and API keys \[read\]

`GET /billing/usage`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/billing/usage`
- Auth: none declared

What the caller spent over a range of UTC days, from both lanes that debit their balance: their sessions (model, capability, connector and runtime calls) and their developer API keys. totals.bySource splits the totals by lane; groups break them down by group_by. A group's key is null where the dimension does not apply to its lane, so the groups always sum to the totals. Per-session detail is GET /sessions/{id}/usage.

## Query parameters

- `from` string, date
- `to` string, date
- `source` 'session' | 'api_key'
- `api_key_id` string
- `group_by` 'day' | 'kind' | 'session' | 'api_key'

## Response `200`

OK

- object
  - `range` object, required
    - `from` string, date
    - `to` string, date
  - `groupBy` 'day' | 'kind' | 'session' | 'api_key', required
  - `totals` object, required
    - `calls` integer
    - `inputTokens` integer
    - `outputTokens` integer
    - `cachedInputTokens` integer
    - `billedCostUsd` number
    - `bySource` object
      - `session` object
        - `calls` integer
        - `inputTokens` integer
        - `outputTokens` integer
        - `cachedInputTokens` integer
        - `billedCostUsd` number
      - `api_key` object
        - `calls` integer
        - `inputTokens` integer
        - `outputTokens` integer
        - `cachedInputTokens` integer
        - `billedCostUsd` number
  - `groups` object[], required
    - `key` string, nullable
    - `label` string
    - `source` 'session' | 'api_key'
    - `calls` integer
    - `inputTokens` integer
    - `outputTokens` integer
    - `cachedInputTokens` integer
    - `billedCostUsd` number

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/billing/usage/get.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
