---
title: "Updates an environment's settings"
method: PATCH
path: "/v1/models/{model_id}/environments/{env_name}"
---

# Updates an environment's settings

`PATCH /v1/models/{model_id}/environments/{env_name}`

Asynchronously updates an environment's settings. Poll the GET endpoint for the applied state.

## Request body

- UpdateEnvironmentRequestV1 — A request to update an environment.
  - `autoscaling_settings` UpdateAutoscalingSettingsV1 — A request to update autoscaling settings for a deployment. All fields are optional, and we only update ones passed in.
    - `min_replica` integer, nullable — Minimum number of replicas
    - `max_replica` integer, nullable — Maximum number of replicas
    - `autoscaling_window` integer, nullable — Timeframe of traffic considered for autoscaling decisions
    - `scale_down_delay` integer, nullable — Waiting period before scaling down any active replica
    - `concurrency_target` integer, nullable — Number of requests per replica before scaling up
    - `target_utilization_percentage` integer, nullable — Target utilization percentage for scaling up/down.
    - `target_in_flight_tokens` integer, nullable — Target number of in-flight tokens for autoscaling decisions. Early access only.
    - `max_scale_down_rate` integer, nullable — Maximum percentage of replicas that can be removed per autoscaling window (1–50). E.g. 20 means at most 20% of replicas are removed per window.
  - `promotion_settings` UpdatePromotionSettingsV1 — Promotion settings for model promotion
    - `redeploy_on_promotion` boolean, nullable — Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image.
    - `rolling_deploy` boolean, nullable — Whether the environment should rely on rolling deploy orchestration.
    - `promotion_cleanup_strategy` 'KEEP' | 'SCALE_TO_ZERO' | 'DEACTIVATE' — The promotion cleanup strategy.
    - `rolling_deploy_config` UpdateRollingDeployConfigV1 — Rolling deploy config for promoting chains and oracles
      - `rolling_deploy_strategy` 'REPLICA' — The rolling deploy strategy.
      - `max_surge_percent` integer, nullable — The maximum surge percentage for rolling deploys.
      - `max_unavailable_percent` integer, nullable — The maximum unavailable percentage for rolling deploys.
      - `stabilization_time_seconds` integer, nullable — The stabilization time in seconds for rolling deploys.
      - `replica_overhead_percent` integer, nullable — The replica overhead percentage for rolling deploys.
    - `ramp_up_while_promoting` boolean, nullable — Whether to ramp up traffic while promoting
    - `ramp_up_duration_seconds` integer, nullable — Duration of the ramp up in seconds

## Response `200`

- UpdateAutoscalingSettingsResponseV1 — The response to a request to update autoscaling settings.
  - `status` 'ACCEPTED' | 'QUEUED' | 'UNCHANGED', required — The status of a request to update autoscaling settings.
  - `message` string, required — A message describing the status of the request to update autoscaling settings

---

[API](https://skmtc.net/baseten/apis/baseten-inference-api.md) · [All operations](https://skmtc.net/baseten/apis/baseten-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/baseten/baseten-inference-api/versions/a55a2f64c3c5/schema)
