---
title: "Read the caller credit balance and recent usage"
method: GET
path: "/api/v1/usage"
tags: ["usage"]
---

# Read the caller credit balance and recent usage

`GET /api/v1/usage`

## Request

- Base URL: `https://mdtidy.com`
- URL: `https://mdtidy.com/api/v1/usage`
- Auth: API key in header `X-API-KEY`

Returns the current wallet balance + recent API calls for the authenticated principal. Cheap; suitable for a dashboard widget.

## Response `200`

Wallet balance + recent calls.

- UsageResponse
  - `subscriptionCredits` integer, required
  - `topupCredits` integer, required
  - `creditsRemaining` integer, required
  - `periodEnd` string, nullable, required
  - `callsThisPeriod` integer, required
  - `recentCalls` object[], required
    - `id` string, uuid, required
    - `endpoint` string, required
    - `statusCode` integer, required
    - `durationMs` integer, required
    - `format` string, nullable, required
    - `creditsCharged` integer, required
    - `errorCode` string, nullable, required
    - `createdAt` string, required

## Other responses

- `401`: X-API-KEY header was not supplied.
- `500`: Server failed to complete the request.

---

[API](https://skmtc.dev/mdtidy/apis/markdown-tidy-api.md) · [All operations](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/revisions/caeec6fad155?raw)
