---
title: "GET /ai/usage/recent"
method: GET
path: "/ai/usage/recent"
tags: ["AI Gateway Usage"]
---

# GET /ai/usage/recent

`GET /ai/usage/recent`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/usage/recent`
- Auth: HTTP bearer

## Query parameters

- `limit` integer
- `offset` integer
- `provider` string
- `model` string
- `project_id` integer
- `status` integer
- `cost_gte` integer
- `cost_gt` integer
- `cost_lte` integer
- `cost_lt` integer
- `tokens_gte` integer
- `tokens_gt` integer
- `tokens_lte` integer
- `tokens_lt` integer

## Response `200`

Page of recent usage log entries

- UsageLogPage: A page of recent usage log entries plus the total count for pagination.
  - `entries` UsageLogEntry[], required: The usage log entries for the requested page.
    - `cache_read_tokens` integer, required: Part of `input_tokens` read from the provider's prompt cache.
    - `cache_write_tokens` integer, required: Part of `input_tokens` written to the provider's prompt cache.
    - `conversation_id` string, nullable
    - `estimated_cost_microcents` integer, required
    - `id` integer, required
    - `input_tokens` integer, required
    - `is_byok` boolean, required
    - `is_streaming` boolean, required
    - `latency_ms` integer, required
    - `model` string, required
    - `output_tokens` integer, required
    - `project_id` integer, nullable: Project the call is attributed to (deployment-token callers only)
    - `provider` string, required
    - `request_id` string, nullable
    - `status` integer, required
    - `tags` string[], required
    - `timestamp` string, required
    - `token_id` integer, nullable: Deployment token the call is attributed to
    - `trace_id` string, nullable
    - `unpriced` boolean, required: The request used tokens but no known price gave its cost, so `estimated_cost_microcents` (zero) is not a price: show it as unknown, not as free.
  - `total` integer, required: Total number of entries matching the filter (across all pages).

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions

## Changes

- **2026-11-15** `425407c64564`: 1 info
  - added the required property `entries/items/unpriced` to the response with the `200` status
- **2026-11-09** `12896146b193`: 2 breaking
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
- **2026-10-23** `7d41b820a372`: 2 info
  - added the required property `entries/items/cache_read_tokens` to the response with the `200` status
  - added the required property `entries/items/cache_write_tokens` to the response with the `200` status
- **2026-10-23** `24af93ff5379`: 2 breaking
  - removed the required property `entries/items/cache_read_tokens` from the response with the `200` status
  - removed the required property `entries/items/cache_write_tokens` from the response with the `200` status
- **2026-10-22** `842d42ed4659`: 2 info
  - added the required property `entries/items/cache_read_tokens` to the response with the `200` status
  - added the required property `entries/items/cache_write_tokens` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/usage/recent/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
