---
title: "Get LLM cost metrics"
method: POST
path: "/llm/cost"
tags: ["Llm"]
---

# Get LLM cost metrics

`POST /llm/cost`

Return current-month total LLM cost and per-model cost timeseries for the tenant.

## Query parameters

- `cookie_name` string, nullable
- `tenant_id` integer

## Request body

- UsageRequest — Generic usage request model for both token and cost queries.
  - `granularity` 'monthly' | 'yearly' | 'custom', required — Aggregation window; 'custom' requires date_start and date_end.
  - `date_start` string, date-time, nullable — Start of the custom range (used only when granularity is 'custom').
  - `date_end` string, date-time, nullable — End of the custom range (used only when granularity is 'custom').

## Response `200`

Successful Response

- TimeseriesResponse — Timeseries response model for LLM costs. Contains total cost for the current month and timeseries data for each model.
  - `total_cost` number, required — Total LLM cost for the current month across all models.
  - `timeseries` object, required — Cost timeseries keyed by model name.

## Other responses

- `401` — Missing or invalid authentication.
- `403` — Admin privileges required.
- `422` — Validation Error

---

[API](https://skmtc.net/neulandai/apis/neuland-ai-hub-api.md) · [All operations](https://skmtc.net/neulandai/apis/neuland-ai-hub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/neulandai/neuland-ai-hub-api/revisions/b53e89b98c2b/schema)
