> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get organization usage costs

> Returns a grand total and a list of daily, per-entity organization usage cost records for the organization in the queried time period (maximum 31 days). All days in both the request and the response are evaluated based on the UTC timezone.

Returns a grand total and a list of daily, per-entity organization usage cost records for the organization in the queried time period (maximum 31 days). All days in both the request and the response are evaluated based on the UTC timezone.


## OpenAPI

````yaml /_specs/cloud-openapi.json get /v1/organizations/{organizationId}/usageCost
openapi: 3.1.2
info:
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
  contact:
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-910487
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
paths:
  /v1/organizations/{organizationId}/usageCost:
    get:
      tags:
        - Billing
      summary: Get organization usage costs
      description: >-
        Returns a grand total and a list of daily, per-entity organization usage
        cost records for the organization in the queried time period (maximum 31
        days). All days in both the request and the response are evaluated based
        on the UTC timezone.
      operationId: usageCostGet
      parameters:
        - in: path
          name: organizationId
          description: ID of the requested organization.
          required: true
          schema:
            type: string
            format: uuid
        - in: query
          name: from_date
          description: Start date for the report, e.g. 2024-12-19.
          schema:
            type: string
            format: date
          required: true
        - in: query
          name: to_date
          description: >-
            End date (inclusive) for the report, e.g. 2024-12-20. This date
            cannot be more than 30 days after from_date (for a maximum queried
            period of 31 days).
          schema:
            type: string
            format: date
          required: true
        - in: query
          name: filter
          description: >-
            Filter criteria to apply when retrieving the usage cost report.
            Currently, only filtering by resource tags is supported.
          schema:
            type: array
            items:
              type: string
          example:
            - tag:Environment=Production
            - tag:Department=Engineering
            - tag:isActive
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 200
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
                  result:
                    $ref: '#/components/schemas/UsageCost'
        '400':
          description: >-
            The request cannot be processed due to a client error. Please verify
            your request parameters and try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 400
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
        '500':
          description: >-
            An internal server error has occurred. If this issue persists,
            please contact ClickHouse Cloud support for assistance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
components:
  schemas:
    UsageCost:
      properties:
        grandTotalCHC:
          description: Grand total cost of usage in ClickHouse Credits (CHCs).
          type: number
        costs:
          type: array
          description: List of daily, per-entity usage cost records.
          items:
            $ref: '#/components/schemas/UsageCostRecord'
    UsageCostRecord:
      properties:
        dataWarehouseId:
          description: ID of the dataWarehouse this entity belongs to (or is).
          type: string
          format: uuid
        serviceId:
          description: >-
            ID of the service this entity belongs to (or is). Set to null for
            dataWarehouse entities.
          type:
            - string
            - 'null'
          format: uuid
        date:
          description: Date of the usage. ISO-8601 date, based on the UTC timezone.
          type: string
          format: date
        entityType:
          description: Type of the entity.
          type: string
          enum:
            - datawarehouse
            - service
            - clickpipe
        entityId:
          description: Unique ID of the entity.
          type: string
          format: uuid
        entityName:
          description: Name of the entity.
          type: string
        metrics:
          $ref: '#/components/schemas/UsageCostMetrics'
        totalCHC:
          description: Total cost of usage in ClickHouse Credits (CHCs) for this entity.
          type: number
        locked:
          description: >-
            When true, the record is immutable. Unlocked records are subject to
            change until locked.
          type: boolean
    UsageCostMetrics:
      properties:
        storageCHC:
          description: >-
            Cost of storage in ClickHouse Credits (CHCs). Applies to
            dataWarehouse entities.
          type: number
        backupCHC:
          description: >-
            Cost of backup in ClickHouse Credits (CHCs). Applies to
            dataWarehouse entities.
          type: number
        computeCHC:
          description: >-
            Cost of compute in ClickHouse Credits (CHCs). Applies to service and
            clickpipe entities.
          type: number
        dataTransferCHC:
          description: >-
            Cost of data transfer in ClickHouse Credits (CHCs). Applies to
            clickpipe entities.
          type: number
        initialLoadCHC:
          description: >-
            Cost of initial load and resyncs in ClickHouse Credits (CHCs).
            Applies to clickpipe entities.
          type: number
        publicDataTransferCHC:
          description: >-
            Cost of data transfer in ClickHouse Credits (CHCs). Applies to
            service entities.
          type: number
        interRegionTier1DataTransferCHC:
          description: >-
            Cost of tier1 inter-region data transfer in ClickHouse Credits
            (CHCs). Applies to service entities.
          type: number
        interRegionTier2DataTransferCHC:
          description: >-
            Cost of tier2 inter-region data transfer in ClickHouse Credits
            (CHCs). Applies to service entities.
          type: number
        interRegionTier3DataTransferCHC:
          description: >-
            Cost of tier3 inter-region data transfer in ClickHouse Credits
            (CHCs). Applies to service entities.
          type: number
        interRegionTier4DataTransferCHC:
          description: >-
            Cost of tier4 inter-region data transfer in ClickHouse Credits
            (CHCs). Applies to service entities.
          type: number
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use key ID and key secret obtained in ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi

````