---
title: "Read this month's credits"
method: GET
path: "/api/v1/usage"
tags: ["debugging"]
---

# Read this month's credits

`GET /api/v1/usage`

## Request

- Base URL: `https://api.past.dev`
- URL: `https://api.past.dev/api/v1/usage`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

The calendar month's credits in UTC. A project key reads the balance and its own project; the management key reads the balance and every live project.

## Response `200`

The month, the balance, and the project or projects.

- UsageSnapshot
  - `month` UsageMonth, required
    - `from` string, date-time, required
    - `to` string, date-time, required
    - `resetsAt` string, date-time, nullable, required: Null with no plan, and where the credits never reset.
  - `balance` UsageBalance, required
    - `left` number, nullable, required
    - `included` integer, nullable, required
    - `bought` number, required
    - `rolledOver` number, required: Unused included credits carried from earlier months.
    - `spent` number, required
  - `project` UsageProjectMonth
    - `slug` string, required
    - `credits` number, nullable, required: Credits this project spent this month. Null with no plan.
    - `ingestions` integer, required
    - `recalls` integer, required
    - `creditCap` integer, nullable, required
    - `creditCapLeft` number, nullable, required
    - `ingestionCap` integer, nullable, required
    - `ingestionCapLeft` integer, nullable, required
  - `projects` UsageProjectMonth[]: With the management key: every live project, heaviest spender first.
    - `slug` string, required
    - `credits` number, nullable, required: Credits this project spent this month. Null with no plan.
    - `ingestions` integer, required
    - `recalls` integer, required
    - `creditCap` integer, nullable, required
    - `creditCapLeft` number, nullable, required
    - `ingestionCap` integer, nullable, required
    - `ingestionCapLeft` integer, nullable, required
  - `metered` boolean, required

## Other responses

- `400`: The request is malformed or violates a field constraint. Match behavior on the response code field.
- `401`: missing-api-key: no bearer. malformed-api-key: the header or the key has the wrong shape, or an agent token was sent to a route that accepts keys only. unauthorized: the key is unknown, expired, revoked, or of the kind this route refuses, or the agent token is invalid or expired.
- `403`: project-archived: the project of the key, or the project an agent token names, is archived. Unarchive it in the console to resume. insufficient-scope: the agent token does not carry the scope of the route.
- `default`: Any other failure uses the same JSON error envelope.

---

[API](https://skmtc.dev/past/apis/past-dev-memory-api.md) · [All operations](https://skmtc.dev/past/apis/past-dev-memory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/past/apis/past-dev-memory-api/revisions/3ddccc19f0eb?raw)
