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

# List model deployment startups

> Lists the replica startups for a model deployment.

<Note>
  This endpoint is in beta. The request and response structure may change before it's generally available.
  Startup metrics require access for your organization. [Contact support](mailto:support@baseten.co) to request access.
</Note>


## OpenAPI

````yaml get /v1/models/{model_id}/deployments/{deployment_id}/startups
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/models/{model_id}/deployments/{deployment_id}/startups:
    parameters:
      - $ref: '#/components/parameters/model_id'
      - $ref: '#/components/parameters/deployment_id'
    get:
      summary: Lists the startups of a model deployment
      description: >-
        Lists replica startups in the given time range, newest first by default.
        Pass the `cursor` from a response to fetch the next page.
      parameters:
        - name: start_epoch_millis
          in: query
          required: true
          description: Start of the query window, in epoch milliseconds.
          schema:
            title: Start Epoch Millis
            type: integer
        - name: end_epoch_millis
          in: query
          required: true
          description: >-
            End of the query window, in epoch milliseconds. Must be after the
            start.
          schema:
            title: End Epoch Millis
            type: integer
        - name: min_duration_ms
          in: query
          required: false
          description: Only include startups that lasted at least this many milliseconds.
          schema:
            anyOf:
              - minimum: 0
                type: integer
              - type: 'null'
            default: null
            title: Min Duration Ms
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque cursor returned by a previous page. Omit to fetch the first
            page. Pass the same filters and sort as the request that returned
            it.
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Cursor
        - name: limit
          in: query
          required: false
          description: Maximum number of attempts to return.
          schema:
            default: 50
            maximum: 100
            minimum: 1
            title: Limit
            type: integer
        - name: outcomes
          in: query
          required: false
          description: >-
            Only include attempts with one of these outcomes. Repeat to pass
            several.
          schema:
            items:
              $ref: '#/components/schemas/StartupOutcomeV1'
            title: Outcomes
            type: array
        - name: phase
          in: query
          required: false
          description: Only include attempts that spent longer than 0 ms in this phase.
          schema:
            anyOf:
              - $ref: '#/components/schemas/StartupPhaseV1'
              - type: 'null'
            default: null
        - name: search
          in: query
          required: false
          description: >-
            Only include attempts whose replica ID matches exactly, or whose
            deployment name contains this text (case-insensitive).
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Search
        - name: sort_by
          in: query
          required: false
          description: Field to sort attempts by. Defaults to `STARTED_AT`.
          schema:
            anyOf:
              - $ref: '#/components/schemas/StartupSortFieldV1'
              - type: 'null'
            default: null
        - name: direction
          in: query
          required: false
          description: Sort direction. Defaults to `desc`.
          schema:
            anyOf:
              - $ref: '#/components/schemas/SortOrderV1'
              - type: 'null'
            default: null
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartupAttemptsV1'
      x-codeSamples:
        - lang: bash
          source: >
            curl --request GET \

            --url
            https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/startups
            \

            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: >-
            import requests

            import os

            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")

            url =
            "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/startups"


            headers = {"Authorization": f"Bearer {API_KEY}"}


            response = requests.request(
                "GET",
                url,
                headers=headers,
                params={'start_epoch_millis': None, 'end_epoch_millis': None, 'min_duration_ms': None, 'cursor': None, 'phase': None, 'search': None, 'sort_by': None, 'direction': None}
            )


            print(response.text)
components:
  parameters:
    model_id:
      schema:
        type: string
      name: model_id
      in: path
      required: true
    deployment_id:
      schema:
        type: string
      name: deployment_id
      in: path
      required: true
  schemas:
    StartupOutcomeV1:
      description: Outcome of a whole startup attempt.
      enum:
        - SUCCESS
        - FAILED
        - STALLED
      title: StartupOutcomeV1
      type: string
    StartupPhaseV1:
      description: >-
        A stage of a replica startup.


        - ``SCHEDULING``: waiting for the replica to be placed on a node.

        - ``IMAGE_PULL``: pulling the container image.

        - ``WEIGHT_DOWNLOAD``: downloading model weights.

        - ``CONTAINER_CREATE``: creating and starting the model container,
        including
          ``CONTAINER_START`` and ``READINESS``.
        - ``CONTAINER_START``: starting the model container.

        - ``READINESS``: waiting for the model to pass its readiness check.


        ``CONTAINER_START`` and ``READINESS`` are accepted as filters but are
        reported only as

        part of ``CONTAINER_CREATE``.
      enum:
        - SCHEDULING
        - IMAGE_PULL
        - WEIGHT_DOWNLOAD
        - CONTAINER_CREATE
        - CONTAINER_START
        - READINESS
      title: StartupPhaseV1
      type: string
    StartupSortFieldV1:
      description: Field to sort startup attempts by.
      enum:
        - OUTCOME
        - STARTED_AT
        - READY_AT
        - DURATION
      title: StartupSortFieldV1
      type: string
    SortOrderV1:
      enum:
        - asc
        - desc
      title: SortOrderV1
      type: string
    StartupAttemptsV1:
      description: A page of startup attempts, newest first by default.
      properties:
        items:
          description: Items in this page.
          items:
            $ref: '#/components/schemas/StartupAttemptV1'
          title: Items
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponseV1'
          description: Pagination metadata for the page.
        total_count:
          description: >-
            Number of attempts matching the filters, counted within the 1,000
            most recent startups in the window.
          title: Total Count
          type: integer
      required:
        - items
        - pagination
        - total_count
      title: StartupAttemptsV1
      type: object
    StartupAttemptV1:
      description: One startup attempt of a replica.
      properties:
        model_id:
          description: Unique identifier of the model.
          title: Model Id
          type: string
        deployment_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Unique identifier of the deployment.
          title: Deployment Id
        deployment_name:
          description: Name of the deployment.
          title: Deployment Name
          type: string
        environment_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Name of the environment. Null when querying a deployment.
          title: Environment Name
        replica_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Identifier of the replica that started.
          title: Replica Id
        started_at_epoch_millis:
          description: Time the attempt started, in epoch milliseconds.
          title: Started At Epoch Millis
          type: integer
        ready_at_epoch_millis:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Time the replica became ready, in epoch milliseconds. Null if it
            never did.
          title: Ready At Epoch Millis
        duration_ms:
          description: Duration of the attempt, in milliseconds.
          title: Duration Ms
          type: integer
        outcome:
          $ref: '#/components/schemas/StartupOutcomeV1'
          description: Outcome of the attempt.
        phase_summary:
          description: Phases recorded during the attempt.
          items:
            $ref: '#/components/schemas/StartupPhaseSummaryV1'
          title: Phase Summary
          type: array
      required:
        - model_id
        - deployment_id
        - deployment_name
        - environment_name
        - replica_id
        - started_at_epoch_millis
        - ready_at_epoch_millis
        - duration_ms
        - outcome
        - phase_summary
      title: StartupAttemptV1
      type: object
    PaginationResponseV1:
      properties:
        has_more:
          description: Whether more items exist after this page.
          title: Has More
          type: boolean
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Opaque cursor to pass into the next request. Null when there is no
            next page.
          title: Cursor
      required:
        - has_more
      title: PaginationResponseV1
      type: object
    StartupPhaseSummaryV1:
      description: One phase recorded during a startup attempt.
      properties:
        phase:
          $ref: '#/components/schemas/StartupPhaseV1'
          description: The phase.
        status:
          $ref: '#/components/schemas/StartupPhaseStatusV1'
          description: Outcome of the phase.
        offset_ms:
          description: >-
            Time from the start of the attempt to the start of the phase, in
            milliseconds.
          title: Offset Ms
          type: integer
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Duration of the phase, in milliseconds. Can be 0 for a phase that
            finished within a second. Null if the phase did not finish.
          title: Duration Ms
      required:
        - phase
        - status
        - offset_ms
        - duration_ms
      title: StartupPhaseSummaryV1
      type: object
    StartupPhaseStatusV1:
      description: Outcome of one phase, independent of the outcome of the whole startup.
      enum:
        - COMPLETED
        - FAILED
      title: StartupPhaseStatusV1
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````