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

# AutoPilot for CI routing history

> One row per job AutoPilot for CI made a decision for in the period, newest first: the workflow run (with a link to it on GitHub), the default and the chosen runner, why, the policy and whether it was set in the workflow file, and the candidates it compared. Once the job has run and been measured (settled), saved and added compare it with its baseline the same way as the savings totals; they are null for a job left on its default runner, one not measured yet, or one with no baseline. failure says why a routed job did not run well on its runner: transient (the provider could not start the runner and it is retried), setup (the provider refused the sandbox's settings), not_picked_up (no runner took the job), failed_here (the job failed on the runner while its last run on the default runner did not), job (its last run on the default runner failed too), too_slow or too_costly; empty when it ran well. failure_provider names the runner's provider. connection, on the row and on each candidate, names the CostGraph sandbox connection behind the runner (null for a GitHub-hosted or third-party label; removed when the connection was deleted). usage is the job's measured CPU and memory (memory_used_ratio is peak over the runner's memory, cpu_used_ratio average over its cores); when it is null, usage_missing says why: not_routed (AutoPilot made no route for the job), other_runner (the job ran on a runner AutoPilot did not launch and no usage step reported), turned_off (CPU and memory measuring is off in settings) or pending (not reported yet). 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/runs
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: operator
    x-group: Operator
  - 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: support
    x-group: Support
  - 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:
    get:
      tags:
        - ci
      summary: AutoPilot for CI routing history
      description: >-
        One row per job AutoPilot for CI made a decision for in the period,
        newest first: the workflow run (with a link to it on GitHub), the
        default and the chosen runner, why, the policy and whether it was set in
        the workflow file, and the candidates it compared. Once the job has run
        and been measured (settled), saved and added compare it with its
        baseline the same way as the savings totals; they are null for a job
        left on its default runner, one not measured yet, or one with no
        baseline. failure says why a routed job did not run well on its runner:
        transient (the provider could not start the runner and it is retried),
        setup (the provider refused the sandbox's settings), not_picked_up (no
        runner took the job), failed_here (the job failed on the runner while
        its last run on the default runner did not), job (its last run on the
        default runner failed too), too_slow or too_costly; empty when it ran
        well. failure_provider names the runner's provider. connection, on the
        row and on each candidate, names the CostGraph sandbox connection behind
        the runner (null for a GitHub-hosted or third-party label; removed when
        the connection was deleted). usage is the job's measured CPU and memory
        (memory_used_ratio is peak over the runner's memory, cpu_used_ratio
        average over its cores); when it is null, usage_missing says why:
        not_routed (AutoPilot made no route for the job), other_runner (the job
        ran on a runner AutoPilot did not launch and no usage step reported),
        turned_off (CPU and memory measuring is off in settings) or pending (not
        reported yet). 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: Pull request number; needs repository
          name: pull_request
          in: query
          schema:
            type: integer
        - description: Only jobs routed to this runner provider
          name: provider
          in: query
          schema:
            type: string
        - description: Only jobs routed to this connection, by its public id
          name: connection
          in: query
          schema:
            type: string
        - description: Number of rows to return (default 50, max 200)
          name: limit
          in: query
          schema:
            type: integer
        - description: Rows 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.CIAutopilotRunList'
        '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.CIAutopilotRunList:
      type: object
      required:
        - items
        - limit
        - offset
        - total_count
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/db.CIAutopilotRun'
        limit:
          type: integer
        offset:
          type: integer
        total_count:
          type: integer
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    db.CIAutopilotRun:
      type: object
      required:
        - baseline_estimated
        - cancelled
        - candidates
        - 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'
        connection:
          allOf:
            - $ref: '#/components/schemas/db.CIRunnerConnection'
          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
        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
        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
        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
        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
    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.