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

# List machine compute usage breakdown



## OpenAPI

````yaml /dcs-openapi.json get /v1/usage/machines/compute
openapi: 3.1.0
info:
  description: Controlplane API for Dedalus Cloud Services (DCS).
  title: Dedalus Cloud Services API
  version: v1
servers:
  - description: Official DCS API
    url: https://dcs.dedaluslabs.ai
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /v1/usage/machines/compute:
    get:
      tags:
        - Usage
        - Machine Lifecycle
      summary: List machine compute usage breakdown
      operationId: listMachineComputeUsage
      parameters:
        - description: Usage period start (YYYY-MM-DD). Defaults to first of current month.
          explode: false
          in: query
          name: period_start
          schema:
            description: >-
              Usage period start (YYYY-MM-DD). Defaults to first of current
              month.
            type: string
        - description: >-
            Last UTC usage date to include (YYYY-MM-DD). Defaults to current
            time.
          explode: false
          in: query
          name: period_end
          schema:
            description: >-
              Last UTC usage date to include (YYYY-MM-DD). Defaults to current
              time.
            type: string
        - description: Optional machine ID filter.
          explode: false
          in: query
          name: machine_id
          schema:
            description: Optional machine ID filter.
            type: string
        - description: 'Usage breakdown granularity: hour or day. Defaults to hour.'
          explode: false
          in: query
          name: granularity
          schema:
            description: 'Usage breakdown granularity: hour or day. Defaults to hour.'
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineComputeUsageBody'
          description: OK
        '400':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Invalid request
        '401':
          content:
            application/json:
              examples:
                invalid_key:
                  value:
                    error_code: AUTH_INVALID
                    message: invalid Dedalus API key
                    retryable: false
                missing_key:
                  value:
                    error_code: AUTH_REQUIRED
                    message: missing Dedalus API key
                    retryable: false
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Authentication required
        '403':
          content:
            application/json:
              examples:
                org_mismatch:
                  value:
                    error_code: AUTH_ORG_MISMATCH
                    message: org scope does not match API key ownership
                    retryable: false
                scope_forbidden:
                  value:
                    error_code: AUTH_SCOPE_FORBIDDEN
                    message: internal service authorization is required
                    retryable: false
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Forbidden
        '500':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Internal server error
        '502':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Billing ledger unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
components:
  schemas:
    MachineComputeUsageBody:
      additionalProperties: false
      properties:
        granularity:
          description: 'Usage breakdown granularity used for rows: hour or day.'
          type: string
        period_end:
          description: Exclusive usage period end.
          format: date-time
          type: string
        period_start:
          description: Inclusive usage period start.
          format: date-time
          type: string
        rows:
          description: Machine-level compute usage breakdown rows.
          items:
            $ref: '#/components/schemas/MachineComputeUsageRowBody'
          type:
            - array
            - 'null'
      required:
        - granularity
        - period_start
        - period_end
        - rows
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    MachineComputeUsageRowBody:
      additionalProperties: false
      properties:
        awake_seconds:
          description: Machine-awake seconds in this bucket.
          format: int64
          type: integer
        bucket_end:
          description: Exclusive usage bucket end.
          format: date-time
          type: string
        bucket_start:
          description: Inclusive usage bucket start.
          format: date-time
          type: string
        cpu_millicore_seconds:
          description: >-
            Requested vCPU millicores multiplied by guest-owned active CPU
            seconds.
          format: int64
          type: integer
        last_window_end:
          description: Latest raw window_end represented by this row.
          format: date-time
          type: string
        latest_stripe_emitted_at:
          description: >-
            Latest Stripe emission timestamp for linked org buckets, when
            emitted.
          format: date-time
          type: string
        machine_id:
          description: Machine identifier.
          type: string
        memory_mib_seconds:
          description: Requested memory MiB multiplied by running allocation seconds.
          format: int64
          type: integer
        org_metering_bucket_ids:
          description: Org compute bucket IDs this row contributes to.
          items:
            type: string
          type:
            - array
            - 'null'
        requested_memory_mib:
          description: Requested memory for this shape, in MiB.
          format: int32
          type: integer
        requested_storage_gib:
          description: Requested storage for this shape, in GiB.
          format: int32
          type: integer
        requested_vcpu:
          description: Requested vCPU for this shape.
          format: double
          type: number
        spec_fingerprint:
          description: Stable fingerprint for the requested machine shape.
          type: string
        stripe_cpu_identifiers:
          description: Stripe CPU meter event identifiers linked to those org buckets.
          items:
            type: string
          type:
            - array
            - 'null'
        stripe_memory_identifiers:
          description: Stripe memory meter event identifiers linked to those org buckets.
          items:
            type: string
          type:
            - array
            - 'null'
        window_count:
          description: Raw usage windows compacted into this row.
          format: int64
          type: integer
      required:
        - machine_id
        - spec_fingerprint
        - requested_vcpu
        - requested_memory_mib
        - requested_storage_gib
        - bucket_start
        - bucket_end
        - awake_seconds
        - cpu_millicore_seconds
        - memory_mib_seconds
        - window_count
        - last_window_end
        - org_metering_bucket_ids
        - stripe_cpu_identifiers
        - stripe_memory_identifiers
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Dedalus API key. Alternative to Bearer token.
      in: header
      name: x-api-key
      type: apiKey
    BearerAuth:
      bearerFormat: Dedalus API key
      description: 'Dedalus API key in Authorization: Bearer <key>.'
      scheme: bearer
      type: http

````