---
title: "Ui View Spend Logs"
method: GET
path: "/spend/logs/v2"
tags: ["Budget & Spend Tracking"]
---

# Ui View Spend Logs

`GET /spend/logs/v2`

View spend logs with pagination support.
Available at both `/spend/logs/v2` (public API) and `/spend/logs/ui` (internal UI).

Returns paginated response with data, total, page, page_size, and total_pages.

Example:
```
curl -X GET "http://0.0.0.0:8000/spend/logs/v2?start_date=2025-11-25%2000:00:00&end_date=2025-11-26%2023:59:59&page=1&page_size=50" -H "Authorization: Bearer sk-1234"
```

## Query parameters

- `api_key` string, nullable — Get spend logs based on api key
- `user_id` string, nullable — Get spend logs based on user_id
- `request_id` string, nullable — request_id to get spend logs for specific request_id
- `session_id` string, nullable — Filter spend logs by session_id (partial string match)
- `team_id` string, nullable — Filter spend logs by team_id
- `min_spend` number, nullable — Filter logs with spend greater than or equal to this value
- `max_spend` number, nullable — Filter logs with spend less than or equal to this value
- `start_date` string, nullable — Time from which to start viewing key spend
- `end_date` string, nullable — Time till which to view key spend
- `page` integer — Page number for pagination
- `page_size` integer — Number of items per page
- `status_filter` string, nullable — Filter logs by status (e.g., success, failure)
- `cache_hit_filter` string, nullable — Filter logs by cache state: 'hit' or 'miss'. Miss includes legacy rows with a null/unknown cache state
- `model` string, nullable — Filter logs by model
- `model_id` string, nullable — Filter logs by model ID (litellm model deployment id)
- `model_group` string, nullable — Filter logs by model group
- `key_alias` string, nullable — Filter logs by key alias
- `end_user` string, nullable — Filter logs by end user
- `error_code` string, nullable — Filter logs by error code (e.g., '404', '500')
- `error_message` string, nullable — Filter logs by error message (partial string match)
- `sort_by` string — Sort logs by field: spend, total_tokens, startTime, endTime, request_duration_ms, model, or ttft_ms
- `sort_order` string, nullable — Sort order: asc or desc
- `exclude_internal_health_checks` boolean — Exclude LiteLLM internal health check requests from results
- `group_by_session` boolean — Paginate over sessions instead of raw logs: one representative row per session, total counts sessions
- `session_cursor` string, nullable — Keyset cursor '<last_activity>|<api_key>|<session_key>' from a previous group_by_session page. UI route only, honored when sorting by startTime
- `search` string, nullable — Match a log whose request_id, api_key (hash), team_id, user, end_user, session_id, or model_id equals this value. request_id matches across all time; the other columns match inside start_date/end_date, which stay required

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-18** `082b5fabd909` — 10 info
  - added the new optional `query` request parameter `cache_hit_filter`
  - added the new optional `query` request parameter `exclude_internal_health_checks`
  - added the new optional `query` request parameter `group_by_session`
  - added the new optional `query` request parameter `model_group`
  - …6 more

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/spend/logs/v2/get.md)

---

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