---
title: "Organization hierarchy with rolled-up consumption"
method: GET
path: "/apiops/projects/{projectName}/credential-organizations/{organizationCode}/usage/hierarchy"
tags: ["UsageReport"]
---

# Organization hierarchy with rolled-up consumption

`GET /apiops/projects/{projectName}/credential-organizations/{organizationCode}/usage/hierarchy`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/credential-organizations/{organizationCode}/usage/hierarchy`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/credential-organizations/:organizationCode/usage/hierarchy/get.ts> (a function with typed inputs; its response is checked against the schema)

The organization's sub-organization tree, each node carrying what its OWN consumers spent (direct) and what the whole subtree spent (rollup); at every node rollup equals direct plus the children's rollup. With level=consumer the consumers themselves are listed, paged. Read from the hourly token rollup, which has no environment dimension, so no environment filter applies.

## Path parameters

- `projectName` string, required
- `organizationCode` string, required

## Query parameters

- `from` string
- `to` string
- `level` string
- `includeDescendants` boolean
- `page` integer
- `size` integer

## Response `200`

successful operation!

- ApiOpsUsageHierarchyDTO: Organization subtree with direct and rolled-up AI consumption, or one page of its consumers.
  - `scope` Scope: The subject of the report.
    - `type` 'ORGANIZATION' | 'CONSUMER' | 'APPLICATION' | 'API_CLIENT' | 'API_PROXY'
    - `key` string: The subject's stable key: organization code, consumerKey, applicationKey, apiClientKey or api proxy name.
    - `name` string: Display name of the subject.
  - `period` Period: Requested and effective period, always UTC.
    - `from` string
    - `to` string
    - `effectiveFrom` string: from, rounded down to the UTC day start when a day-grained source was read.
    - `effectiveTo` string: to, rounded up to the end of its UTC day when a day-grained source was read.
    - `timeZone` string
  - `filters` Filters: Applied filters.
    - `model` string: Exact LLM model id the report was narrowed to, or null.
    - `environmentName` string: Environment name the traffic-log blocks were narrowed to, or null for every environment of the project.
    - `environmentApplied` boolean: False when environmentName could not be applied to a block because its source carries no environment dimension.
  - `level` 'ORGANIZATION' | 'CONSUMER': Which level was asked for.
  - `dataSource` string: Where the figures came from.
  - `freshness` string: How fresh the figures are.
  - `nodes` Node[]: The subtree, when level=ORGANIZATION. Null otherwise.
    - `code` string: The organization's portable code. Null for a synthetic node.
    - `name` string: Display name.
    - `classification` 'ORGANIZATION' | 'UNASSIGNED' | 'ANONYMOUS': What this node is.
    - `depth` integer: Depth below the requested root; the root itself is 0.
    - `shared` boolean: True when the organization is owned by another project and only shared with this one.
    - `memberCount` integer: Consumers that belong to this organization directly.
    - `descendantMemberCount` integer: Consumers of this organization and of every organization below it.
    - `direct` Totals: Summed consumption.
      - `tokenInput` integer
      - `tokenOutput` integer
      - `tokenCached` integer
      - `tokenTotal` integer: tokenInput + tokenOutput + tokenCached.
      - `costUsd` number: Cost in US dollars.
      - `requests` integer
      - `failedRequests` integer
    - `rollup` Totals: Summed consumption.
      - `tokenInput` integer
      - `tokenOutput` integer
      - `tokenCached` integer
      - `tokenTotal` integer: tokenInput + tokenOutput + tokenCached.
      - `costUsd` number: Cost in US dollars.
      - `requests` integer
      - `failedRequests` integer
    - `budgetPercent` number, double: Percentage of the node's monthly token budget the rollup represents. Null when there is no budget, or the period is not a single calendar month.
    - `children` unknown
  - `members` MemberPage: A page of consumers.
    - `content` Member[]
      - `consumerKey` string: The consumer's portable key. Null when the consumer no longer resolves; its figures are still counted.
      - `name` string: Display name. Null together with consumerKey.
      - `organizationCode` string: Code of the organization the consumer belongs to.
      - `organizationPath` string: Human-readable organization path, root first.
      - `usage` Totals: Summed consumption.
        - `tokenInput` integer
        - `tokenOutput` integer
        - `tokenCached` integer
        - `tokenTotal` integer: tokenInput + tokenOutput + tokenCached.
        - `costUsd` number: Cost in US dollars.
        - `requests` integer
        - `failedRequests` integer
      - `budgetPercent` number, double: Percentage of the consumer's monthly token budget. Null when there is no budget, or the period is not a single calendar month.
    - `totalElements` integer: Consumers in the whole (filtered) list, not only on this page.
    - `page` integer
    - `size` integer
  - `partial` boolean: True when a source could not be read; the answer is still 200 with what was readable.
  - `notes` string[]: Machine-readable notes explaining zero or missing numbers.

## Other responses

- `400`: Invalid period or level, or the platform (admin) project.
- `401`: not authorized for this operation!

## Changes

- **2026-10-20** `d1a546deccf0`: 6 breaking
  - for the `query` request parameter `includeDescendants`, default value `false` was added
  - removed the enum value `consumer` from the `query` request parameter `level`
  - removed the enum value `organization` from the `query` request parameter `level`
  - for the `query` request parameter `page`, the format changed from no format to `int32`
  - …2 more
  - …this revision’s changelog is incomplete
- **2026-09-12** `90cf59a80235`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apinizer/apis/apinizer-management-apis/changes/apiops/projects/:projectName/credential-organizations/:organizationCode/usage/hierarchy/get.md)

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
