> ## 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 one AutoPilot for CI run

> The measured CPU and memory of one job from the routing history: summary is the history row with the job's conclusion, start, end, and disk and network totals in bytes, and cpu as a share of the runner's cores (above 1 when a job bursts past the size AutoPilot launched; mean is the average, max the peak, p50 to p99 the per-second percentiles; min, std_dev and last are not measured and stay 0), null when the job was not measured; series gives memory (GB) and CPU (cores) per 5 second bucket, each with t seconds from the start and its absolute time at, with memory_total_gb and cpu_total_cores as the runner's size; steps gives the job's GitHub steps once the job history has them, with start_offset_s and end_offset_s in seconds from the start and duration_s in seconds; egress gives bytes per network destination, or null with egress_missing not_available when network tracing did not run. When the job was not measured, summary.usage is null, summary.usage_missing says why and series is empty.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/ci/autopilot/runs/{decision_id}/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: 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/runs/{decision_id}/usage:
    get:
      tags:
        - ci
      summary: CPU and memory use of one AutoPilot for CI run
      description: >-
        The measured CPU and memory of one job from the routing history: summary
        is the history row with the job's conclusion, start, end, and disk and
        network totals in bytes, and cpu as a share of the runner's cores (above
        1 when a job bursts past the size AutoPilot launched; mean is the
        average, max the peak, p50 to p99 the per-second percentiles; min,
        std_dev and last are not measured and stay 0), null when the job was not
        measured; series gives memory (GB) and CPU (cores) per 5 second bucket,
        each with t seconds from the start and its absolute time at, with
        memory_total_gb and cpu_total_cores as the runner's size; steps gives
        the job's GitHub steps once the job history has them, with
        start_offset_s and end_offset_s in seconds from the start and duration_s
        in seconds; egress gives bytes per network destination, or null with
        egress_missing not_available when network tracing did not run. When the
        job was not measured, summary.usage is null, summary.usage_missing says
        why and series is empty.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: decision_id of the history row
          name: decision_id
          in: path
          required: true
          schema:
            type: string
        - description: job of the history row
          name: job
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/db.CIAutopilotRunUsage'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '404':
          description: Not Found
          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.CIAutopilotRunUsage:
      type: object
      required:
        - egress_missing
        - series
        - steps
        - summary
      properties:
        cpu_total_cores:
          type: number
          nullable: true
        egress:
          type: array
          items:
            $ref: '#/components/schemas/db.CIRunUsageEgress'
          nullable: true
        egress_missing:
          type: string
          enum:
            - ''
            - not_available
        memory_total_gb:
          type: number
          nullable: true
        series:
          type: array
          items:
            $ref: '#/components/schemas/db.CIRunUsagePoint'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/db.CIRunUsageStep'
        summary:
          $ref: '#/components/schemas/db.CIAutopilotRunUsageSummary'
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    db.CIRunUsageEgress:
      type: object
      required:
        - bytes_in
        - bytes_out
        - destination
        - port
      properties:
        bytes_in:
          type: integer
        bytes_out:
          type: integer
        destination:
          type: string
        port:
          type: integer
    db.CIRunUsagePoint:
      type: object
      required:
        - at
        - cpu_cores
        - mem_gb
        - t
      properties:
        at:
          type: string
        cpu_cores:
          type: number
        cpu_share:
          type: number
          nullable: true
        mem_gb:
          type: number
        t:
          type: integer
    db.CIRunUsageStep:
      type: object
      required:
        - conclusion
        - egress
        - name
        - number
      properties:
        completed_at:
          type: string
          nullable: true
        conclusion:
          type: string
        duration_s:
          type: number
          nullable: true
        egress:
          type: array
          items:
            $ref: '#/components/schemas/db.CIRunUsageEgress'
        end_offset_s:
          type: number
          nullable: true
        name:
          type: string
        number:
          type: integer
        start_offset_s:
          type: number
          nullable: true
        started_at:
          type: string
          nullable: true
    db.CIAutopilotRunUsageSummary:
      type: object
      required:
        - baseline_estimated
        - cancelled
        - candidates
        - conclusion
        - decided_at
        - decision_id
        - default_runner
        - event
        - failure
        - failure_provider
        - git_keys
        - job
        - policy
        - provider
        - reason
        - repository
        - run_attempt
        - run_id
        - run_url
        - runner
        - settled
        - source
        - usage_missing
        - watch_state
        - workflow
        - workflow_path
      properties:
        actual_cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        added_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        added_wall_seconds:
          type: number
          nullable: true
        baseline_estimated:
          type: boolean
        cancelled:
          type: boolean
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/db.CIAutopilotRunCandidate'
        conclusion:
          type: string
        connection:
          allOf:
            - $ref: '#/components/schemas/db.CIRunnerConnection'
          nullable: true
        cpu:
          allOf:
            - $ref: '#/components/schemas/schema.StatsRow'
          nullable: true
        decided_at:
          type: string
        decision_id:
          type: string
        default_cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        default_price_per_hour:
          type: number
          x-semantic: costAmount
          nullable: true
        default_runner:
          type: string
        disk_read_bytes:
          type: integer
          nullable: true
        disk_write_bytes:
          type: integer
          nullable: true
        duration_seconds:
          type: number
          nullable: true
        ended_at:
          type: string
          nullable: true
        estimated_cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        event:
          type: string
        failure:
          type: string
          enum:
            - ''
            - transient
            - setup
            - not_picked_up
            - out_of_memory
            - failed_here
            - job
            - too_slow
            - too_costly
        failure_provider:
          type: string
        git_keys:
          type: array
          items:
            type: string
        job:
          type: string
        machine:
          allOf:
            - $ref: '#/components/schemas/db.CIRunnerMachine'
          nullable: true
        net_in_bytes:
          type: integer
          nullable: true
        net_out_bytes:
          type: integer
          nullable: true
        policy:
          type: string
          enum:
            - cheapest
            - balanced
            - fastest
        provider:
          type: string
        pull_request:
          type: integer
          nullable: true
        reason:
          type: string
        repository:
          type: string
        run_attempt:
          type: integer
        run_id:
          type: integer
        run_url:
          type: string
        runner:
          type: string
        samples:
          type: integer
          nullable: true
        saved_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        saved_wall_seconds:
          type: number
          nullable: true
        settled:
          type: boolean
        sizing:
          allOf:
            - $ref: '#/components/schemas/db.CIRunSizing'
          nullable: true
        source:
          type: string
          enum:
            - settings
            - git
        started_at:
          type: string
          nullable: true
        usage:
          allOf:
            - $ref: '#/components/schemas/db.CIRunUsage'
          nullable: true
        usage_missing:
          type: string
          enum:
            - ''
            - not_routed
            - other_runner
            - turned_off
            - pending
        watch_state:
          type: string
          enum:
            - ''
            - healthy
            - cancelled
            - rerun
            - unknown
            - release
        workflow:
          type: string
        workflow_path:
          type: string
    db.CIAutopilotRunCandidate:
      type: object
      required:
        - eligible
        - label
        - measured
        - provider
        - reason
      properties:
        connection:
          allOf:
            - $ref: '#/components/schemas/db.CIRunnerConnection'
          nullable: true
        cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        eligible:
          type: boolean
        idle:
          type: boolean
          nullable: true
        instance_type:
          type: string
          nullable: true
        label:
          type: string
        machine:
          allOf:
            - $ref: '#/components/schemas/db.CIRunnerMachine'
          nullable: true
        measured:
          type: boolean
        node_price_per_hour:
          type: number
          x-semantic: costAmount
          nullable: true
        node_share_per_hour:
          type: number
          x-semantic: costAmount
          nullable: true
        price_per_hour:
          type: number
          x-semantic: costAmount
          nullable: true
        provider:
          type: string
        reason:
          type: string
        wall_seconds:
          type: number
          nullable: true
    db.CIRunnerConnection:
      type: object
      required:
        - id
        - name
        - removed
      properties:
        cluster:
          type: string
          nullable: true
        cluster_id:
          type: string
          nullable: true
        id:
          type: string
        name:
          type: string
        removed:
          type: boolean
    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
    db.CIRunnerMachine:
      type: object
      required:
        - ram_gb
        - size
        - vcpus
      properties:
        ram_gb:
          type: number
        size:
          type: string
        vcpus:
          type: integer
    db.CIRunSizing:
      type: object
      required:
        - kind
        - measured_runs
      properties:
        kind:
          type: string
          enum:
            - downsized
            - stepped_up
            - default_size
        measured_runs:
          type: integer
        need_ram_gb:
          type: number
          nullable: true
        oom_floor_gb:
          type: number
          nullable: true
    db.CIRunUsage:
      type: object
      required:
        - cpu_avg_cores
        - cpu_p50
        - cpu_p90
        - cpu_p95
        - cpu_p99
        - cpu_peak_cores
        - cpu_total_cores
        - final
        - memory_peak_gb
        - memory_total_gb
        - oom_kills
        - source
      properties:
        cpu_avg_cores:
          type: number
        cpu_p50:
          type: number
        cpu_p90:
          type: number
        cpu_p95:
          type: number
        cpu_p99:
          type: number
        cpu_peak_cores:
          type: number
        cpu_total_cores:
          type: number
        cpu_used_ratio:
          type: number
          nullable: true
        final:
          type: boolean
        memory_peak_gb:
          type: number
        memory_total_gb:
          type: number
        memory_used_ratio:
          type: number
          nullable: true
        oom_kills:
          type: integer
        source:
          type: string
          enum:
            - sandbox
            - dispatcher
            - arc
            - action
            - usage-step
            - cluster
  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.