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

# Cost facets

> Distinct provider, service category, region, resource type, sub-account, tag and extension values the selected period holds, for building filter lists. The lists describe the whole period and do not narrow with filters, so the same lists serve every view of that period.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/cost/facets
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: context-graph
    x-group: Context graph
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network
    x-group: Network
  - 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: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: ticketing
    x-group: Ticketing
  - 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/cost/facets:
    get:
      tags:
        - cost
      summary: Cost facets
      description: >-
        Distinct provider, service category, region, resource type, sub-account,
        tag and extension values the selected period holds, for building filter
        lists. The lists describe the whole period and do not narrow with
        filters, so the same lists serve every view of that period.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: Cost period; defaults to month_to_date
          name: period
          in: query
          schema:
            type: string
            enum:
              - month_to_date
              - last_7d
              - last_30d
              - calendar_month
              - custom
        - description: >-
            Closed calendar month in YYYY-MM format; required when
            period=calendar_month
          name: month
          in: query
          schema:
            type: string
        - description: Window start in RFC3339 format; required when period=custom
          name: start
          in: query
          schema:
            type: string
        - description: Window end in RFC3339 format; required when period=custom
          name: end
          in: query
          schema:
            type: string
        - description: >-
            Cost layer; defaults to billed. ci returns CI runner job rows,
            including each job's share of a vendor bill.
          name: layer
          in: query
          schema:
            type: string
            enum:
              - billed
              - allocation
              - ci
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/cost.Facets'
        '400':
          description: Bad Request
          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
    cost.Facets:
      type: object
      properties:
        extensions:
          description: |-
            Provider extension values present in the underlying rows, keyed by
            extension key. Extension keys are provider-specific.
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        provider:
          description: |-
            Provider values present in the underlying rows, for building a
            provider filter.
          type: array
          items:
            $ref: '#/components/schemas/cost.FacetOption'
        region:
          description: Region values present in the underlying rows.
          type: array
          items:
            $ref: '#/components/schemas/cost.FacetOption'
        resource_type:
          description: Resource type values present in the underlying rows.
          type: array
          items:
            $ref: '#/components/schemas/cost.FacetOption'
        service_category:
          description: Service category values present in the underlying rows.
          type: array
          items:
            $ref: '#/components/schemas/cost.FacetOption'
        sub_account:
          description: |-
            Sub-account values present in the underlying rows. Only populated
            when the request set include_sub_accounts=true.
          type: array
          items:
            $ref: '#/components/schemas/cost.FacetOption'
        tags:
          description: |-
            Tag values present in the underlying rows, keyed by tag key. Absent
            when no tag filters apply to the report.
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        truncated:
          description: |-
            Names of the facets above whose value list was cut off at
            FacetValueLimit distinct values. Absent when no facet was truncated.
          type: array
          items:
            type: string
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    cost.FacetOption:
      type: object
      properties:
        label:
          description: |-
            Display label for Value. Absent when the backend has no friendlier
            name than the value itself.
          type: string
        value:
          description: Raw dimension value to send back as a filter.
          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.