> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Explain kubernetes clusters summary spend change

> Returns the clusters most responsible for the period-over-period change in cluster spend, for the tenant selected by the X-CostGraph-Tenant-ID header



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/clusters/summary/explain
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: infracost
    x-group: Infracost
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: service-map
    x-group: Service map
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /api/v1/tenant/clusters/summary/explain:
    get:
      tags:
        - kubernetes-clusters
      summary: Explain kubernetes clusters summary spend change
      description: >-
        Returns the clusters most responsible for the period-over-period change
        in cluster spend, for the tenant selected by the X-CostGraph-Tenant-ID
        header
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: Filter by cloud provider (repeat param or comma-separated)
          name: providers
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - description: Filter by cluster status (repeat param or comma-separated)
          name: status
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - description: Filter by operator version (repeat param or comma-separated)
          name: operator_versions
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - description: Filter by Kubernetes version (repeat param or comma-separated)
          name: kubernetes_versions
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - description: Filter by region (repeat param or comma-separated)
          name: regions
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - description: >-
            Cost period (month_to_date, last_7d, last_30d, calendar_month,
            custom)
          name: period
          in: query
          schema:
            type: string
        - description: Calendar month for calendar_month period (YYYY-MM)
          name: month
          in: query
          schema:
            type: string
        - description: Start date for custom period (YYYY-MM-DD)
          name: start
          in: query
          schema:
            type: string
        - description: End date for custom period (YYYY-MM-DD)
          name: end
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/k8scluster.SpendChangeExplanation'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    k8scluster.SpendChangeExplanation:
      type: object
      required:
        - contributors
        - currency
        - current_cost
        - period
        - period_end
        - period_start
        - previous_period_end
        - previous_period_start
      properties:
        change_amount:
          description: |-
            Signed absolute change of CurrentCost against PreviousCost, in
            Currency. Null under the same condition as PreviousCost.
          type: number
          x-semantic: costAmount
          nullable: true
        change_percent:
          description: >-
            Signed percent change of CurrentCost against PreviousCost. Null
            under

            the same condition as PreviousCost.
          type: number
          x-semantic: percentage
          nullable: true
        contributors:
          description: >-
            Clusters that contributed to the change, sorted by the magnitude of

            their ChangeAmount descending so Contributors[0] moved spend the
            most.
          type: array
          items:
            $ref: '#/components/schemas/k8scluster.SpendChangeContributor'
        currency:
          description: Billing currency the cost figures are expressed in.
          type: string
          x-semantic: currencyCode
        current_cost:
          description: |-
            Combined spend across matching clusters in the selected period, in
            Currency.
          type: number
          x-semantic: costAmount
        period:
          description: |-
            Named period the explanation covers, e.g. "month_to_date" or
            "last_30d", matching the request's period filter.
          type: string
        period_end:
          description: End of the selected period, exclusive.
          type: string
        period_start:
          description: Start of the selected period, inclusive.
          type: string
        previous_cost:
          description: |-
            Combined spend across matching clusters in the previous period, in
            Currency. Null when the previous period has no comparable cost data,
            in which case ChangeAmount and ChangePercent are also null.
          type: number
          x-semantic: costAmount
          nullable: true
        previous_period_end:
          description: End of the comparable previous period, exclusive.
          type: string
        previous_period_start:
          description: Start of the comparable previous period, inclusive.
          type: string
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    k8scluster.SpendChangeContributor:
      type: object
      required:
        - change_amount
        - cluster_id
        - cluster_name
        - current_cost
        - kind
        - previous_cost
      properties:
        change_amount:
          description: |-
            Signed absolute change in this cluster's cost against the previous
            period, in the response Currency. Positive means spend went up.
          type: number
          x-semantic: costAmount
        cluster_id:
          description: Unique identifier of the contributing cluster.
          type: string
          x-semantic: resourceId
        cluster_name:
          description: Display name of the contributing cluster.
          type: string
        current_cost:
          description: >-
            This cluster's spend in the selected period, in the response
            Currency.
          type: number
          x-semantic: costAmount
        event_at:
          description: |-
            When this cluster first became active (Kind "added") or last was
            active (Kind "removed"). Absent when Kind is "changed".
          type: string
        kind:
          description: >-
            How this cluster contributed to the overall spend change: "added"
            when

            it had no cost in the previous period, "removed" when it has no cost

            in the current period, "changed" otherwise.
          type: string
        previous_cost:
          description: >-
            This cluster's spend in the previous period, in the response
            Currency.
          type: number
          x-semantic: costAmount
        provider:
          description: |-
            Cloud provider the cluster runs on. Absent when the underlying rows
            have no provider value.
          type: string
  securitySchemes:
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.