> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Right-size CI jobs

> For each workflow job or pipeline step that ran in the range, whether its runner size should shrink, grow or stay, with confidence, reasons and estimated…



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /ci/analytics/rightsize
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: FeatureFlags
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: AwsAmp
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: Integrations
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: EksPrometheus
  - name: EksLoki
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleCategories
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: GitHub Actions
  - name: CI Analytics
  - name: Alerts
  - name: Gitlab
  - name: Slack
  - name: Git
  - name: MergeQueues
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Domains
  - name: AcmCertificates
  - name: NotificationDestinations
  - name: NotificationDispatches
  - name: NotificationEvents
  - name: NotificationRules
  - name: Activity
  - name: Describe
  - name: Reports
  - name: Support
  - name: BillingPlans
  - name: BillingAccounts
  - name: BillingCycles
  - name: BillingUsageSummaries
  - name: BillingAddOns
  - name: BillingInvoices
  - name: Authorization
  - name: Sandboxes
  - name: SandboxCommands
  - name: SandboxPorts
  - name: Apps
paths:
  /ci/analytics/rightsize:
    get:
      tags:
        - CI Analytics
      summary: Right-size CI jobs
      description: >-
        For each workflow job or pipeline step that ran in the range, whether
        its runner size should shrink, grow or stay, with confidence, reasons
        and estimated monthly savings. Decided from its runs at its current size
        with automatic sizing's rules: memory at the p99 peak plus 15% and 1
        GiB, doubled after an OOM kill; CPU grown when the p90 run's sustained
        load is at 90% of the booked vCPU, shrunk to where the p99 run's lands
        at 85%. EC2 runners move within their instance family. Steps of system
        pipelines, such as the Terraform change pipeline, are left out: Ravion
        sizes their runners. Shrinking first, then growing, then keeping; within
        each, the largest savings first. With source, scopeId and name, only
        that job. Returns 503 when CI analytics are not configured.
      operationId: ListCIAnalyticsRightsize
      parameters:
        - $ref: '#/components/parameters/CIAnalytics.Filters.from'
        - $ref: '#/components/parameters/CIAnalytics.Filters.to'
        - $ref: '#/components/parameters/CIAnalytics.Filters.executionEnvironmentId'
        - $ref: '#/components/parameters/CIAnalytics.Filters.codeSourceId'
        - $ref: '#/components/parameters/CIAnalytics.Filters.pipelineId'
        - $ref: '#/components/parameters/CIAnalytics.Filters.source'
        - $ref: '#/components/parameters/CIAnalytics.Filters.runnerSize'
        - $ref: '#/components/parameters/CIAnalytics.Filters.conclusion'
        - $ref: '#/components/parameters/CIAnalytics.Filters.scopeId'
        - $ref: '#/components/parameters/CIAnalytics.Filters.name'
        - description: Only jobs whose suggestion moves the size (down or up).
          in: query
          name: actionable
          schema:
            nullable: true
            type: boolean
        - description: How many jobs to return, 1 to 200. Defaults to 50.
          in: query
          name: limit
          schema:
            format: int32
            maximum: 200
            minimum: 1
            nullable: true
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CIAnalytics.Rightsize'
                    type: array
                required:
                  - data
                type: object
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Service unavailable.
components:
  parameters:
    CIAnalytics.Filters.from:
      description: First day of the range (UTC), inclusive.
      in: query
      name: from
      required: true
      schema:
        format: date
        type: string
    CIAnalytics.Filters.to:
      description: >-
        Last day of the range (UTC), inclusive. Must be on or after from; the
        range covers at most 400 days.
      in: query
      name: to
      required: true
      schema:
        format: date
        type: string
    CIAnalytics.Filters.executionEnvironmentId:
      description: Only jobs that ran in this execution environment.
      in: query
      name: executionEnvironmentId
      schema:
        nullable: true
        type: string
    CIAnalytics.Filters.codeSourceId:
      description: >-
        Only GitHub Actions jobs of this code source (repository). Returns 403
        when the caller cannot read it.
      in: query
      name: codeSourceId
      schema:
        nullable: true
        type: string
    CIAnalytics.Filters.pipelineId:
      description: Only steps of this pipeline. Returns 403 when the caller cannot read it.
      in: query
      name: pipelineId
      schema:
        nullable: true
        type: string
    CIAnalytics.Filters.source:
      description: Only jobs from this source.
      in: query
      name: source
      schema:
        allOf:
          - $ref: '#/components/schemas/CIAnalytics.Source'
        nullable: true
    CIAnalytics.Filters.runnerSize:
      description: >-
        Only jobs booked at this runner size, as Job.runnerSize labels it (for
        example "8 vCPU / 32 GiB").
      in: query
      name: runnerSize
      schema:
        nullable: true
        type: string
    CIAnalytics.Filters.conclusion:
      description: Only jobs that ended this way.
      in: query
      name: conclusion
      schema:
        allOf:
          - $ref: '#/components/schemas/CIAnalytics.Conclusion'
        nullable: true
    CIAnalytics.Filters.scopeId:
      description: >-
        With name (and source), only one workflow job or pipeline step: the code
        source ID for GitHub Actions jobs, the pipeline ID for pipeline steps.
      in: query
      name: scopeId
      schema:
        nullable: true
        type: string
    CIAnalytics.Filters.name:
      description: >-
        With scopeId, only the workflow job or pipeline step of this name, as
        Workload.name gives it.
      in: query
      name: name
      schema:
        nullable: true
        type: string
  schemas:
    CIAnalytics.Rightsize:
      additionalProperties: false
      description: >-
        One workflow job or pipeline step's runner size recommendation, from its
        runs at its current size (the size its newest run booked) that
        succeeded, failed or timed out in the range.
      properties:
        bookedCpu:
          format: double
          type: number
        bookedMemoryGib:
          format: double
          type: number
        confidence:
          $ref: '#/components/schemas/CIAnalytics.RightsizeConfidence'
        cpuP95:
          description: >-
            The p95 across runs of each run's p95 vCPU; absent when no run
            measured CPU.
          format: double
          type: number
        cpuSustainedP99:
          description: >-
            The p99 across runs of each run's sustained load (its p90 vCPU, or
            its peak without percentiles); absent when no run measured CPU.
          format: double
          type: number
        direction:
          $ref: '#/components/schemas/CIAnalytics.RightsizeDirection'
        estimatedMonthlySavingsUsd:
          description: >-
            What the suggestion saves each month in estimated AWS compute spend
            at those minutes, negative when it costs more. Sandbox sizes are
            priced at the pool's reference rates, EC2 types at on-demand list
            prices. Absent when direction is keep or a size has no known price,
            such as on Spot EC2 runners.
          format: double
          type: number
        executionEnvironmentId:
          description: Where the newest run ran.
          type: string
        failureRate:
          description: Runs that failed or timed out over runs.
          format: double
          type: number
        instanceType:
          description: The EC2 instance type of the current size; empty on sandbox runners.
          type: string
        lastRunAt:
          description: When the newest run at the current size finished.
          format: date-time
          type: string
        measuredRuns:
          description: >-
            Of those, runs that measured CPU or memory. Growing or shrinking for
            headroom needs 10; an OOM kill grows memory on its own.
          format: int64
          type: integer
        monthlyRunMinutes:
          description: >-
            Run minutes at the current size, extrapolated to 30 days from the
            days since its first run in the range.
          format: double
          type: number
        name:
          description: >-
            "workflow / job" for GitHub Actions jobs, the step ID for pipeline
            steps, as Workload.name gives it.
          type: string
        oomKills:
          description: Kernel OOM kills inside the runs.
          format: int64
          type: integer
        peakMemoryMibP95:
          description: >-
            Peak memory percentiles across runs, in MiB; absent when no run
            measured memory.
          format: double
          type: number
        peakMemoryMibP99:
          format: double
          type: number
        reasons:
          description: Why, most important first.
          items:
            type: string
          type: array
        runnerSize:
          description: The current size, as Job.runnerSize labels it.
          type: string
        runs:
          description: Runs at the current size.
          format: int64
          type: integer
        scopeId:
          description: >-
            The code source ID for GitHub Actions jobs, the pipeline ID for
            pipeline steps.
          type: string
        scopeLabel:
          description: >-
            The repository for GitHub Actions jobs, the pipeline's name for
            pipeline steps.
          type: string
        sizesBooked:
          description: >-
            How many sizes the job's runs booked in the range. More than one
            suggests cpu=auto or memory=auto, which already sizes each run.
          format: int32
          type: integer
        source:
          $ref: '#/components/schemas/CIAnalytics.Source'
        suggestedCpu:
          format: double
          type: number
        suggestedInstanceType:
          description: >-
            The suggested EC2 instance type, from the current type's family;
            empty on sandbox runners.
          type: string
        suggestedMemoryGib:
          format: double
          type: number
        suggestedRunnerSize:
          description: The suggested size; the current one when direction is keep.
          type: string
      required:
        - source
        - scopeId
        - scopeLabel
        - name
        - executionEnvironmentId
        - runnerSize
        - instanceType
        - bookedCpu
        - bookedMemoryGib
        - suggestedRunnerSize
        - suggestedInstanceType
        - suggestedCpu
        - suggestedMemoryGib
        - direction
        - confidence
        - reasons
        - runs
        - measuredRuns
        - failureRate
        - sizesBooked
        - oomKills
        - monthlyRunMinutes
        - lastRunAt
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows Ravion staff to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Internal error details are visible only to
            Ravion staff.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    CIAnalytics.Source:
      description: >-
        Where a job ran from: a GitHub Actions job on a Ravion runner, or a
        pipeline step.
      enum:
        - github_actions
        - pipeline
      type: string
    CIAnalytics.Conclusion:
      description: How a job ended.
      enum:
        - success
        - failure
        - cancelled
        - timed_out
        - skipped
      type: string
    CIAnalytics.RightsizeConfidence:
      description: >-
        How sure a recommendation is: more measured runs raise it; varying run
        times or memory peaks, failures, and several sizes booked in the range
        lower it.
      enum:
        - low
        - medium
        - high
      type: string
    CIAnalytics.RightsizeDirection:
      description: Which way a job's runner size should move.
      enum:
        - down
        - up
        - keep
      type: string
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.