---
title: "Get per-task cost aggregates from usage_ledger (admin only)"
method: GET
path: "/v1/admin/costs/by-task"
---

# Get per-task cost aggregates from usage_ledger (admin only)

`GET /v1/admin/costs/by-task`

## Request

- Base URL: `https://api.clichefactory.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.clichefactory.com/v1/admin/costs/by-task`
- Auth: none declared

## Query parameters

- `tenant_id` string, required
- `from_date` string, nullable
- `to_date` string, nullable
- `operation` string, nullable
- `include_adjustments` boolean: Include admin_adjustment rows. Ignored when operation is set.

## Headers

- `X-API-KEY` string, nullable

## Response `200`

Successful Response

- CostByTaskResponse
  - `tenant_id` string, required
  - `period` object, required
  - `items` CostByTaskItem[], required
    - `task_id` string, required
    - `category` string, nullable
    - `total_credits` integer
    - `total_charged_usd` number
    - `total_llm_cost_usd` number
    - `total_pages` integer
    - `extraction_count` integer
    - `document_count` integer
    - `margin_usd` number
    - `margin_pct` number

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/clichefactory/apis/aio-server.md) · [All operations](https://skmtc.dev/clichefactory/apis/aio-server/llms.txt) · [OpenAPI document](https://skmtc.dev/clichefactory/apis/aio-server/revisions/9bd59f9bbb31?raw)
