> ## 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.

# Get kubernetes cluster workload container detail

> Returns the detailed right-sizing report for a single workload container, including metadata, the current resource footprint, cost and efficiency, and a per-replica CPU/memory usage-vs-request trend over the trailing 7 days (hourly points), for the tenant selected by the X-CostGraph-Tenant-ID header. available_usage_dimensions lists the dimensions this container actually has measurements for, so a caller only offers the ones the usage endpoint can answer; it is empty when the container has none.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details
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/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details:
    get:
      tags:
        - kubernetes-clusters
      summary: Get kubernetes cluster workload container detail
      description: >-
        Returns the detailed right-sizing report for a single workload
        container, including metadata, the current resource footprint, cost and
        efficiency, and a per-replica CPU/memory usage-vs-request trend over the
        trailing 7 days (hourly points), for the tenant selected by the
        X-CostGraph-Tenant-ID header. available_usage_dimensions lists the
        dimensions this container actually has measurements for, so a caller
        only offers the ones the usage endpoint can answer; it is empty when the
        container has none.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: Kubernetes cluster ID
          name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - description: Kubernetes workload resource ID
          name: resource_id
          in: path
          required: true
          schema:
            type: string
        - description: Container name
          name: container_name
          in: path
          required: true
          schema:
            type: string
        - description: Observation window (7d, 30d)
          name: window
          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.WorkloadContainerDetails
        '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'
        '404':
          description: Not Found
          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.WorkloadContainerDetails:
      type: object
      required:
        - available_usage_dimensions
        - container
        - cost_and_efficiency
        - resource_footprint
        - usage_request_series
      properties:
        available_usage_dimensions:
          type: array
          items:
            type: string
        container:
          $ref: '#/components/schemas/k8scluster.WorkloadContainerMeta'
        cost_and_efficiency:
          $ref: '#/components/schemas/k8scluster.WorkloadCostDetails'
        gpu:
          allOf:
            - $ref: '#/components/schemas/k8scluster.WorkloadGPURecommendation'
          nullable: true
        resource_footprint:
          $ref: '#/components/schemas/k8scluster.WorkloadResourceFootprint'
        usage_request_series:
          description: trailing-7d CPU/memory usage-vs-request trend
          allOf:
            - $ref: >-
                #/components/schemas/k8scluster.WorkloadContainerUsageRequestSeries
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    k8scluster.WorkloadContainerMeta:
      type: object
      required:
        - api_version
        - cluster
        - created_at
        - kind
        - name
        - namespace
        - recommendation
        - replica_count
        - resource_id
        - status
        - workload_name
      properties:
        api_version:
          type: string
        cluster:
          type: string
        created_at:
          type: string
        kind:
          type: string
        name:
          type: string
        namespace:
          type: string
        recommendation:
          $ref: '#/components/schemas/k8scluster.Recommendation'
        replica_count:
          type: integer
        resource_id:
          type: string
        status:
          type: string
        workload_name:
          type: string
    k8scluster.WorkloadCostDetails:
      type: object
      required:
        - cpu_urgency
        - dimensions_flagged
        - memory_urgency
        - monthly_cost
        - total_cost_mtd
      properties:
        cpu_urgency:
          type: string
        dimensions_flagged:
          type: integer
        memory_urgency:
          type: string
        monthly_cost:
          type: number
        recommended_cost_mtd:
          description: or null, for no recommendation
          type: number
          nullable: true
        savings_mtd:
          description: or null, for no recommendation
          type: number
          nullable: true
        savings_percentage_mtd:
          description: or null, for no recommendation
          type: number
          nullable: true
        total_cost_mtd:
          type: number
    k8scluster.WorkloadGPURecommendation:
      type: object
      required:
        - current_count
        - reason
        - recommendation
      properties:
        current_count:
          type: number
        memory_p95:
          type: number
          nullable: true
        reason:
          type: string
        recommendation:
          type: string
        recommended_count:
          type: number
          nullable: true
        utilization_band:
          type: string
        utilization_p95:
          type: number
          nullable: true
    k8scluster.WorkloadResourceFootprint:
      type: object
      required:
        - current_limit
        - current_request
        - current_usage
      properties:
        current_limit:
          $ref: '#/components/schemas/k8scluster.ResourceAmounts'
        current_request:
          $ref: '#/components/schemas/k8scluster.ResourceAmounts'
        current_usage:
          $ref: '#/components/schemas/k8scluster.ResourceAmounts'
    k8scluster.WorkloadContainerUsageRequestSeries:
      type: object
      required:
        - cpu
        - end
        - memory
        - start
        - step_seconds
      properties:
        cpu:
          description: per-replica CPU usage-vs-request trend, in cores
          allOf:
            - $ref: '#/components/schemas/k8scluster.WorkloadContainerResourceTrend'
        end:
          description: end of the window, truncated to the hour
          type: string
        memory:
          description: per-replica memory usage-vs-request trend, in bytes
          allOf:
            - $ref: '#/components/schemas/k8scluster.WorkloadContainerResourceTrend'
        start:
          description: start of the usage-vs-request window, 7 days before End
          type: string
        step_seconds:
          description: spacing between trend points in seconds (3600, the rollup is hourly)
          type: integer
    k8scluster.Recommendation:
      type: object
      required:
        - cpu
        - memory
      properties:
        cpu:
          type: string
        memory:
          type: string
    k8scluster.ResourceAmounts:
      type: object
      required:
        - cpu
        - memory
      properties:
        cpu:
          type: number
        memory:
          type: number
    k8scluster.WorkloadContainerResourceTrend:
      type: object
      required:
        - limit
        - request
        - unit
        - usage
      properties:
        limit:
          description: >-
            per-replica limit from the workload spec, constant across the
            window; 0 = no limit configured
          type: number
        request:
          description: configured request per hourly bucket
          type: array
          items:
            $ref: '#/components/schemas/metrics.MetricPoint'
        unit:
          description: 'unit of every point''s value: "cores" or "bytes"'
          type: string
        usage:
          description: observed usage per hourly bucket
          type: array
          items:
            $ref: '#/components/schemas/metrics.MetricPoint'
    metrics.MetricPoint:
      type: object
      required:
        - t
        - v
      properties:
        t:
          type: integer
        v:
          type: number
  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.