> ## 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 environment replicas

> Lists the replicas of an environment.



## OpenAPI

````yaml get /v1/models/{model_id}/environments/{env_name}/replicas
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}/environments/{env_name}/replicas:
    parameters:
      - $ref: '#/components/parameters/model_id'
      - $ref: '#/components/parameters/env_name'
    get:
      summary: Lists replicas for an environment
      description: >-
        Includes retained terminated replicas from deployments active in the
        preceding hour. Orders replicas oldest first, with replica ID breaking
        ties. Pass pagination.cursor with unchanged filters for subsequent
        pages. Cursors pin deployment membership and expire after one hour.
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque cursor returned by a previous page. Omit to fetch the first
            page.
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Cursor
        - name: limit
          in: query
          required: false
          description: Maximum number of items to return.
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
        - name: statuses
          in: query
          required: false
          description: >-
            Replica statuses to include. Repeat the statuses query parameter to
            filter by multiple statuses. Omit to include all statuses, including
            terminated replicas.
          schema:
            items:
              $ref: '#/components/schemas/DeploymentReplicaStatusV1'
            title: Statuses
            type: array
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentReplicasV1'
      x-codeSamples:
        - lang: bash
          source: >
            curl --request GET \

            --url
            https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas
            \

            --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}/environments/{env_name}/replicas"


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


            response = requests.request(
                "GET",
                url,
                headers=headers,
                params={'cursor': None}
            )


            print(response.text)
components:
  parameters:
    model_id:
      schema:
        type: string
      name: model_id
      in: path
      required: true
    env_name:
      schema:
        type: string
      name: env_name
      in: path
      required: true
  schemas:
    DeploymentReplicaStatusV1:
      enum:
        - STARTING
        - ACTIVE
        - UNHEALTHY
        - TERMINATING
        - TERMINATED
        - UNKNOWN
      title: DeploymentReplicaStatusV1
      type: string
    DeploymentReplicasV1:
      properties:
        items:
          description: Items in this page.
          items:
            $ref: '#/components/schemas/DeploymentReplicaV1'
          title: Items
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponseV1'
          description: Pagination metadata for the page.
      required:
        - items
        - pagination
      title: DeploymentReplicasV1
      type: object
    DeploymentReplicaV1:
      properties:
        id:
          description: >-
            Pod-name suffix used for replica lookup and termination, usually
            five characters.
          title: Id
          type: string
        deployment_id:
          description: ID of the replica's deployment.
          title: Deployment Id
          type: string
        deployment_name:
          description: Name of the replica's deployment.
          title: Deployment Name
          type: string
        status:
          $ref: '#/components/schemas/DeploymentReplicaStatusV1'
          description: Current replica lifecycle status.
        created_at:
          description: Replica creation time in ISO 8601 format.
          format: date-time
          title: Created At
          type: string
        terminated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Observed termination completion time in ISO 8601 format, or null if
            unavailable.
          title: Terminated At
        age_seconds:
          description: Age in seconds since creation, frozen at termination.
          title: Age Seconds
          type: number
        restart_count:
          anyOf:
            - type: integer
            - type: 'null'
          description: Model container lifetime restart count, or null if unavailable.
          title: Restart Count
      required:
        - id
        - deployment_id
        - deployment_name
        - status
        - created_at
        - terminated_at
        - age_seconds
        - restart_count
      title: DeploymentReplicaV1
      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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````