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

# CPU and memory use of CI jobs

> How much of their runner's memory and CPU the GitHub Actions jobs that finished in the period used, measured on runners AutoPilot for CI launched and wherever else usage was captured; jobs on other runners count in unmeasured_runs. memory_used_ratio is peak memory over the runner's memory and cpu_used_ratio average CPU over the runner's cores; on a runner AutoPilot launched, the runner's memory and cores are the size it launched, so a job that bursts past that size reads above 1; p50 and p90 are across measured runs. idle_memory_gb_hours sums (runner memory - peak) x run hours, and idle_cpu_core_hours sums (runner cores - average cores) x run hours, over measured runs. jobs gives one row per job and runner with at least one measured run, sorted by memory_used_ratio_max ascending unless sort and order say otherwise; memory_total_gb and cpu_total_cores are the size of the job's latest run, and memory_used_ratio_max is memory_peak_gb_max, the highest peak across its runs, over that size; run_seconds_avg and run_seconds_max are the average and longest run time of the job's measured runs. cpu gives the job's CPU as a share of the runner's cores across its measured runs: mean averages the runs' average use, max is the highest peak, and p50 to p99 are the highest of the runs' per-second percentiles; min, std_dev and last are not measured and stay 0. A job measured by the usage step or a runner AutoPilot launched shows as soon as its reading is stored; until GitHub's job record arrives its run time is the length of the reading. series gives the measured runs and median ratios per UTC day. Defaults to the last 30 days; a period over 400 days is rejected.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/ci/autopilot/usage/summary
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: sandboxes
    x-group: Sandboxes
  - 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/ci/autopilot/usage/summary:
    get:
      tags:
        - ci
      summary: CPU and memory use of CI jobs
      description: >-
        How much of their runner's memory and CPU the GitHub Actions jobs that
        finished in the period used, measured on runners AutoPilot for CI
        launched and wherever else usage was captured; jobs on other runners
        count in unmeasured_runs. memory_used_ratio is peak memory over the
        runner's memory and cpu_used_ratio average CPU over the runner's cores;
        on a runner AutoPilot launched, the runner's memory and cores are the
        size it launched, so a job that bursts past that size reads above 1; p50
        and p90 are across measured runs. idle_memory_gb_hours sums (runner
        memory - peak) x run hours, and idle_cpu_core_hours sums (runner cores -
        average cores) x run hours, over measured runs. jobs gives one row per
        job and runner with at least one measured run, sorted by
        memory_used_ratio_max ascending unless sort and order say otherwise;
        memory_total_gb and cpu_total_cores are the size of the job's latest
        run, and memory_used_ratio_max is memory_peak_gb_max, the highest peak
        across its runs, over that size; run_seconds_avg and run_seconds_max are
        the average and longest run time of the job's measured runs. cpu gives
        the job's CPU as a share of the runner's cores across its measured runs:
        mean averages the runs' average use, max is the highest peak, and p50 to
        p99 are the highest of the runs' per-second percentiles; min, std_dev
        and last are not measured and stay 0. A job measured by the usage step
        or a runner AutoPilot launched shows as soon as its reading is stored;
        until GitHub's job record arrives its run time is the length of the
        reading. series gives the measured runs and median ratios per UTC day.
        Defaults to the last 30 days; a period over 400 days is rejected.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: First day, YYYY-MM-DD
          name: from
          in: query
          schema:
            type: string
        - description: Day after the last day, YYYY-MM-DD
          name: to
          in: query
          schema:
            type: string
        - description: owner/name
          name: repository
          in: query
          schema:
            type: string
        - description: Workflow file; needs repository
          name: workflow_path
          in: query
          schema:
            type: string
        - description: Job column to sort by
          name: sort
          in: query
          schema:
            type: string
            enum:
              - memory_used_ratio_max
              - memory_peak_gb_max
              - cpu_used_ratio_avg
              - cpu_p95_max
              - measured_runs
              - oom_runs
              - last_run_at
              - run_seconds_avg
              - run_seconds_max
        - description: asc (default) or desc
          name: order
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
        - description: Number of jobs to return (default 50, max 200)
          name: limit
          in: query
          schema:
            type: integer
        - description: Jobs to skip before returning results (default 0)
          name: offset
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/db.CIUsageSummary'
        '400':
          description: Bad Request
          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
    db.CIUsageSummary:
      type: object
      required:
        - idle_cpu_core_hours
        - idle_memory_gb_hours
        - jobs
        - jobs_total_count
        - limit
        - measured_runs
        - offset
        - oom_runs
        - series
        - unmeasured_runs
      properties:
        cpu_used_ratio_p50:
          type: number
          nullable: true
        cpu_used_ratio_p90:
          type: number
          nullable: true
        idle_cpu_core_hours:
          type: number
        idle_memory_gb_hours:
          type: number
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/db.CIUsageJob'
        jobs_total_count:
          type: integer
        limit:
          type: integer
        measured_runs:
          type: integer
        memory_used_ratio_p50:
          type: number
          nullable: true
        memory_used_ratio_p90:
          type: number
          nullable: true
        offset:
          type: integer
        oom_runs:
          type: integer
        series:
          type: array
          items:
            $ref: '#/components/schemas/db.CIUsageDay'
        unmeasured_runs:
          type: integer
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    db.CIUsageJob:
      type: object
      required:
        - cpu
        - cpu_p95_max
        - cpu_total_cores
        - job
        - last_run_at
        - measured_runs
        - memory_peak_gb_max
        - memory_peak_gb_p50
        - memory_total_gb
        - oom_runs
        - repository
        - run_seconds_avg
        - run_seconds_max
        - runner
        - workflow
        - workflow_path
      properties:
        cpu:
          $ref: '#/components/schemas/schema.StatsRow'
        cpu_p95_max:
          type: number
        cpu_total_cores:
          type: number
        cpu_used_ratio_avg:
          type: number
          nullable: true
        job:
          type: string
        last_run_at:
          type: string
        measured_runs:
          type: integer
        memory_peak_gb_max:
          type: number
        memory_peak_gb_p50:
          type: number
        memory_total_gb:
          type: number
        memory_used_ratio_max:
          type: number
          nullable: true
        oom_runs:
          type: integer
        repository:
          type: string
        run_seconds_avg:
          type: number
        run_seconds_max:
          type: integer
        runner:
          type: string
        workflow:
          type: string
        workflow_path:
          type: string
    db.CIUsageDay:
      type: object
      required:
        - date
        - measured_runs
      properties:
        cpu_used_ratio_p50:
          type: number
          nullable: true
        date:
          type: string
          format: date
        measured_runs:
          type: integer
        memory_used_ratio_p50:
          type: number
          nullable: true
    schema.StatsRow:
      type: object
      properties:
        id:
          type: string
        last:
          type: number
        max:
          type: number
        mean:
          type: number
        min:
          type: number
        p50:
          type: number
        p90:
          type: number
        p95:
          type: number
        p99:
          type: number
        std_dev:
          type: number
        tenant_id:
          description: Tenant that owns the row. @rls:tenant
          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.