> ## 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, newest first, over the last 90 days: 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.



## 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: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - 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:
    get:
      tags:
        - ci
      summary: AutoPilot for CI routing history
      description: >-
        One row per job AutoPilot for CI made a decision for, newest first, over
        the last 90 days: 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.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          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: 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
        - git_keys
        - job
        - policy
        - provider
        - reason
        - repository
        - run_attempt
        - run_id
        - run_url
        - runner
        - settled
        - source
        - 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'
        decided_at:
          type: string
        decision_id:
          type: string
        default_cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        default_runner:
          type: string
        estimated_cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        event:
          type: string
        git_keys:
          type: array
          items:
            type: string
        job:
          type: string
        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
        source:
          type: string
          enum:
            - settings
            - git
        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:
        cost_usd:
          type: number
          x-semantic: costAmount
          nullable: true
        eligible:
          type: boolean
        label:
          type: string
        measured:
          type: boolean
        provider:
          type: string
        reason:
          type: string
        wall_seconds:
          type: number
          nullable: true
  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.