> ## 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 billing usage

> Returns the organization's CostGraph charges for a billing period as a FinOps FOCUS 1.2 dataset, one record per tenant per meter. Optional ?period=YYYY-MM (defaults to current month).



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/billing/usage
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/billing/usage:
    get:
      tags:
        - billing
      summary: Get billing usage
      description: >-
        Returns the organization's CostGraph charges for a billing period as a
        FinOps FOCUS 1.2 dataset, one record per tenant per meter. Optional
        ?period=YYYY-MM (defaults to current month).
      parameters:
        - description: Billing period as YYYY-MM
          name: period
          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/billing.FocusUsage'
        '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'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    billing.FocusUsage:
      type: object
      properties:
        charges:
          $ref: '#/components/schemas/billing.ChargeRollup'
        focus_version:
          type: string
        period:
          type: string
        rows:
          type: array
          items:
            $ref: '#/components/schemas/focus.Record'
        totals:
          $ref: '#/components/schemas/billing.FocusTotals'
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    billing.ChargeRollup:
      type: object
      properties:
        comparable:
          type: boolean
        groups:
          type: array
          items:
            $ref: '#/components/schemas/billing.ChargeGroup'
    focus.Record:
      type: object
      properties:
        AvailabilityZone:
          type: string
        BilledCost:
          type: string
        BillingAccountId:
          type: string
        BillingAccountName:
          type: string
        BillingAccountType:
          type: string
        BillingCurrency:
          type: string
        BillingPeriodEnd:
          type: string
        BillingPeriodStart:
          type: string
        CapacityReservationId:
          type: string
        CapacityReservationStatus:
          type: string
        ChargeCategory:
          type: string
        ChargeClass:
          type: string
        ChargeDescription:
          type: string
        ChargeFrequency:
          type: string
        ChargePeriodEnd:
          type: string
        ChargePeriodStart:
          type: string
        CommitmentDiscountCategory:
          type: string
        CommitmentDiscountId:
          type: string
        CommitmentDiscountName:
          type: string
        CommitmentDiscountQuantity:
          type: string
        CommitmentDiscountStatus:
          type: string
        CommitmentDiscountType:
          type: string
        CommitmentDiscountUnit:
          type: string
        ConsumedQuantity:
          type: string
        ConsumedUnit:
          type: string
        ContractedCost:
          type: string
        ContractedUnitPrice:
          type: string
        EffectiveCost:
          type: string
        InvoiceId:
          type: string
        InvoiceIssuer:
          type: string
        ListCost:
          type: string
        ListUnitPrice:
          type: string
        PricingCategory:
          type: string
        PricingCurrency:
          type: string
        PricingCurrencyContractedUnitPrice:
          type: string
        PricingCurrencyEffectiveCost:
          type: string
        PricingCurrencyListUnitPrice:
          type: string
        PricingQuantity:
          type: string
        PricingUnit:
          type: string
        Provider:
          type: string
        Publisher:
          type: string
        RegionId:
          type: string
        RegionName:
          type: string
        ResourceId:
          type: string
        ResourceName:
          type: string
        ResourceType:
          type: string
        ServiceCategory:
          type: string
        ServiceName:
          type: string
        ServiceSubcategory:
          type: string
        SkuId:
          type: string
        SkuMeter:
          type: string
        SkuPriceDetails:
          type: array
          items:
            type: integer
        SkuPriceId:
          type: string
        SubAccountId:
          type: string
        SubAccountName:
          type: string
        SubAccountType:
          type: string
        Tags:
          type: array
          items:
            type: integer
    billing.FocusTotals:
      type: object
      properties:
        billed_cost:
          type: string
        billing_currency:
          type: string
        effective_cost:
          type: string
        list_cost:
          type: string
    billing.ChargeGroup:
      type: object
      properties:
        billedCost:
          type: number
        changePct:
          type: number
        chargeCategory:
          type: string
        children:
          type: array
          items:
            $ref: '#/components/schemas/billing.ChargeGroup'
        contractedCost:
          type: number
        current:
          type: number
        dimension:
          type: string
        key:
          type: string
        listCost:
          type: number
        previous:
          type: number
        share:
          type: number
        usageQuantity:
          type: number
        usageUnit:
          type: string
  securitySchemes:
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header
    ApiKeyAuth:
      description: API key for machine-to-machine authentication
      type: apiKey
      name: X-API-Key
      in: header

````

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