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

# Get an environment replica

> Gets a single replica of an environment.



## OpenAPI

````yaml get /v1/models/{model_id}/environments/{env_name}/replicas/{replica_id}
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/{replica_id}:
    parameters:
      - $ref: '#/components/parameters/model_id'
      - $ref: '#/components/parameters/env_name'
      - $ref: '#/components/parameters/replica_id'
    get:
      summary: Gets a replica in an environment
      description: >-
        Searches deployments active in the environment during the preceding
        hour. Includes retained terminated replicas. Returns 404 if the replica
        is outside this scope. Returns 400 if multiple replicas match the
        replica ID.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentReplicaV1'
      x-codeSamples:
        - lang: bash
          source: >
            curl --request GET \

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

            --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/{replica_id}"


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


            response = requests.request(
                "GET",
                url,
                headers=headers,
                json={}
            )


            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
    replica_id:
      schema:
        type: string
      name: replica_id
      in: path
      required: true
  schemas:
    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
    DeploymentReplicaStatusV1:
      enum:
        - STARTING
        - ACTIVE
        - UNHEALTHY
        - TERMINATING
        - TERMINATED
        - UNKNOWN
      title: DeploymentReplicaStatusV1
      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.

````