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

# Query cloud and SaaS spend as billed by the vendor

> OpenCost-compatible cloud cost query over every provider CostGraph ingests a bill for, cloud and SaaS alike. Costs are the vendor's own, not CostGraph's allocation of them.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/opencost/cloudCost
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/opencost/cloudCost:
    get:
      tags:
        - opencost
      summary: Query cloud and SaaS spend as billed by the vendor
      description: >-
        OpenCost-compatible cloud cost query over every provider CostGraph
        ingests a bill for, cloud and SaaS alike. Costs are the vendor's own,
        not CostGraph's allocation of them.
      parameters:
        - description: >-
            Duration (7d, 24h), 'today', 'yesterday', or a comma-separated
            RFC3339 pair
          name: window
          in: query
          required: true
          schema:
            type: string
        - description: >-
            Comma-separated list of invoiceEntityID, accountID, regionID,
            availabilityZone, provider, providerID, category, service
          name: aggregate
          in: query
          schema:
            type: string
        - description: Duration of each returned set; defaults to the whole window
          name: step
          in: query
          schema:
            type: string
        - description: Collapse the range into a single set
          name: accumulate
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.cloudCostEnvelope'
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
        '401':
          description: Unauthorized
          content:
            application/json:
              schema: {}
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: {}
      security:
        - BearerAuth: []
components:
  schemas:
    controllers.cloudCostEnvelope:
      type: object
      properties:
        code:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/opencost.CloudCostSet'
    opencost.CloudCostSet:
      type: object
      properties:
        aggregationProperties:
          type: array
          items:
            type: string
        cloudCosts:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/opencost.CloudCost'
        window:
          $ref: '#/components/schemas/opencost.Window'
    opencost.CloudCost:
      type: object
      properties:
        amortizedCost:
          $ref: '#/components/schemas/opencost.CostMetric'
        amortizedNetCost:
          $ref: '#/components/schemas/opencost.CostMetric'
        invoicedCost:
          $ref: '#/components/schemas/opencost.CostMetric'
        listCost:
          $ref: '#/components/schemas/opencost.CostMetric'
        netCost:
          $ref: '#/components/schemas/opencost.CostMetric'
        properties:
          $ref: '#/components/schemas/opencost.CloudCostProperties'
        window:
          $ref: '#/components/schemas/opencost.Window'
    opencost.Window:
      type: object
    opencost.CostMetric:
      type: object
      properties:
        cost:
          type: number
        kubernetesPercent:
          type: number
    opencost.CloudCostProperties:
      type: object
      properties:
        accountID:
          type: string
        accountName:
          description: '@bingen:field[version=3]'
          type: string
        availabilityZone:
          description: '@bingen:field[version=3]'
          type: string
        category:
          type: string
        invoiceEntityID:
          type: string
        invoiceEntityName:
          description: '@bingen:field[version=3]'
          type: string
        labels:
          $ref: '#/components/schemas/opencost.CloudCostLabels'
        provider:
          type: string
        providerID:
          type: string
        regionID:
          description: '@bingen:field[version=3]'
          type: string
        service:
          type: string
    opencost.CloudCostLabels:
      type: object
      additionalProperties:
        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.