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

# Terminate environment replica

> Terminates a replica in an environment and returns the termination status.



## OpenAPI

````yaml delete /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'
    delete:
      summary: Terminates a replica in an environment
      description: >-
        Requests replica termination in the environment's current deployment.
        Returns 404 if the environment has no current deployment or no replica
        matches the replica ID. Returns 400 without requesting termination if
        multiple replicas in the current deployment match the replica ID.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminateReplicaResponseV1'
      x-codeSamples:
        - lang: bash
          source: >
            curl --request DELETE \

            --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(
                "DELETE",
                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:
    TerminateReplicaResponseV1:
      description: The response to a request to terminate a replica in a deployment.
      properties:
        success:
          default: true
          description: Whether the replica was successfully terminated
          title: Success
          type: boolean
      title: TerminateReplicaResponseV1
      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.

````