---
title: "Get Ai Usage By Operation"
method: GET
path: "/admin/ai-usage/by-operation"
tags: ["admin"]
---

# Get Ai Usage By Operation

`GET /admin/ai-usage/by-operation`

## Request

- Base URL: `https://studio-api.meganova.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://studio-api.meganova.ai/admin/ai-usage/by-operation`
- Auth: OAuth 2
  - Password
  - Token URL: `auth/token`

Get usage breakdown by operation type.

## Query parameters

- `user_id` string, uuid, nullable
- `days` integer, nullable: Limit to the last N days (all time if omitted)

## Response `200`

Successful Response

- UsageByOperationResponse[]
  - `operation_type` string, required
  - `count` integer, required
  - `total_tokens` integer, required
  - `total_cost` string, required
  - `total_credits` integer
  - `average_duration_ms` number, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `c683584f6060`: 1 info
  - the `items/total_cost` response's property pattern `^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$` was removed for the status `200`
- **2026-09-26** `b57a65c0cc03`: 1 info
  - added the new optional `query` request parameter `days`

[Operation history](https://skmtc.dev/meganova/apis/meganova-api/changes/admin/ai-usage/by-operation/get.md)

---

[API](https://skmtc.dev/meganova/apis/meganova-api.md) - [All operations](https://skmtc.dev/meganova/apis/meganova-api/llms.txt) - [OpenAPI document](https://skmtc.dev/meganova/apis/meganova-api/revisions/c683584f6060?raw)
