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

# Get one repository's CI cost page

> Serves one GitHub repository's CI cost trend, slowest jobs, queue-bound jobs, flaky jobs, and rerun waste over the period, which defaults to the last 30 days and takes the same period, start and end the cost pages send. Passing workflow narrows every section to that workflow by name, and workflow_path narrows to one file when two workflows share a name; without either the page covers the whole repository. workflows lists every workflow the repository ran in the period, whatever the filter, so the page can offer them as filter options. The job rows read ci_job_attempts over the period with billed cost attributed pro rata by run seconds within each billing cell, the same split the queue-bound and flaky-job findings use; each job row carries its top five steps by median step duration with coverage, aggregated from the steps column over the same window. The trend reads the priced CI rollup. Monthly figures scale the period's cost to a month. Queue-bound jobs wait at a median queue-to-run ratio of at least one or a p95 queue of ten minutes or more; flaky jobs rerun at a rate of at least twenty percent. Queue time never bills, so those lanes are velocity context, verified on queue time falling.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/ci/workflows
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/workflows:
    get:
      tags:
        - ci
      summary: Get one repository's CI cost page
      description: >-
        Serves one GitHub repository's CI cost trend, slowest jobs, queue-bound
        jobs, flaky jobs, and rerun waste over the period, which defaults to the
        last 30 days and takes the same period, start and end the cost pages
        send. Passing workflow narrows every section to that workflow by name,
        and workflow_path narrows to one file when two workflows share a name;
        without either the page covers the whole repository. workflows lists
        every workflow the repository ran in the period, whatever the filter, so
        the page can offer them as filter options. The job rows read
        ci_job_attempts over the period with billed cost attributed pro rata by
        run seconds within each billing cell, the same split the queue-bound and
        flaky-job findings use; each job row carries its top five steps by
        median step duration with coverage, aggregated from the steps column
        over the same window. The trend reads the priced CI rollup. Monthly
        figures scale the period's cost to a month. Queue-bound jobs wait at a
        median queue-to-run ratio of at least one or a p95 queue of ten minutes
        or more; flaky jobs rerun at a rate of at least twenty percent. Queue
        time never bills, so those lanes are velocity context, verified on queue
        time falling.
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: GitHub organization
          name: organization
          in: query
          required: true
          schema:
            type: string
        - description: Repository name within the organization
          name: repository
          in: query
          required: true
          schema:
            type: string
        - description: Period preset
          name: period
          in: query
          schema:
            type: string
            enum:
              - month_to_date
              - last_7d
              - last_30d
              - calendar_month
              - custom
        - description: Month for calendar_month, YYYY-MM
          name: month
          in: query
          schema:
            type: string
        - description: Period start, RFC 3339, for custom
          name: start
          in: query
          schema:
            type: string
        - description: Period end, RFC 3339, for custom
          name: end
          in: query
          schema:
            type: string
        - description: Limit the page to one workflow by name
          name: workflow
          in: query
          schema:
            type: string
        - description: >-
            Limit the page to one workflow by file path, for names shared across
            files
          name: workflow_path
          in: query
          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.CIWorkflowPage'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/middleware.SubscriptionRequiredResponse'
      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.CIWorkflowPage:
      type: object
      required:
        - flaky_jobs
        - organization
        - queue_bound
        - repository
        - rerun_waste_monthly_usd
        - slowest_jobs
        - total_monthly_usd
        - trend
        - workflows
      properties:
        flaky_jobs:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowSlowJob'
        organization:
          type: string
        queue_bound:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowSlowJob'
        repository:
          type: string
        rerun_waste_monthly_usd:
          type: number
        slowest_jobs:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowSlowJob'
        total_monthly_usd:
          type: number
        trend:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowTrendPoint'
        workflows:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowOption'
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    middleware.SubscriptionRequiredResponse:
      type: object
      required:
        - code
        - message
        - status
      properties:
        code:
          type: string
          enum:
            - subscription_required
            - free_plan_limit
            - reporting_paused
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    db.CIWorkflowSlowJob:
      type: object
      required:
        - arch
        - job_name
        - monthly_cost_usd
        - os
        - queue_p50_seconds
        - queue_p95_seconds
        - rerun_rate
        - run_p50_seconds
        - runner_label
        - runner_vendor
        - runs
        - steps_runs
        - top_steps
        - workflow
        - workflow_path
      properties:
        arch:
          type: string
        cpu_cores:
          type: integer
          nullable: true
        job_name:
          type: string
        monthly_cost_usd:
          type: number
        os:
          type: string
        queue_p50_seconds:
          type: number
        queue_p95_seconds:
          type: number
        rerun_rate:
          type: number
        run_p50_seconds:
          type: number
        runner_label:
          type: string
        runner_vendor:
          type: string
        runs:
          type: integer
        steps_runs:
          type: integer
        top_steps:
          type: array
          items:
            $ref: '#/components/schemas/db.CIWorkflowStep'
        workflow:
          type: string
        workflow_path:
          type: string
    db.CIWorkflowTrendPoint:
      type: object
      required:
        - billed_cost
        - billed_minutes
        - day
        - failed_runs
        - runs
      properties:
        billed_cost:
          type: number
        billed_minutes:
          type: number
        day:
          type: string
          format: date
        failed_runs:
          type: integer
        runs:
          type: integer
    db.CIWorkflowOption:
      type: object
      required:
        - runs
        - workflow
        - workflow_path
      properties:
        runs:
          type: integer
        workflow:
          type: string
        workflow_path:
          type: string
    db.CIWorkflowStep:
      type: object
      required:
        - step_fail_rate
        - step_name
        - step_p50_seconds
        - step_runs
      properties:
        step_fail_rate:
          type: number
        step_name:
          type: string
        step_p50_seconds:
          type: number
        step_runs:
          type: integer
  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.