curl --request POST \
--url https://api.baseten.co/v1/models/{model_id}/environments \
--header "Authorization: Api-Key $BASETEN_API_KEY" \
--data '{
  "name": "staging",
  "autoscaling_settings": {
    "autoscaling_window": 800,
    "concurrency_target": 3,
    "max_replica": 2,
    "min_replica": 1,
    "scale_down_delay": 60
  },
  "promotion_settings": {
    "ramp_up_duration_seconds": 600,
    "ramp_up_while_promoting": true,
    "redeploy_on_promotion": true
  }
}'
{
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "model_id": "<string>",
  "current_deployment": {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "model_id": "<string>",
    "is_production": true,
    "is_development": true,
    "status": "BUILDING",
    "active_replica_count": 123,
    "autoscaling_settings": {
      "min_replica": 123,
      "max_replica": 123,
      "autoscaling_window": 123,
      "scale_down_delay": 123,
      "concurrency_target": 123
    },
    "environment": "<string>"
  },
  "autoscaling_settings": {
    "min_replica": 123,
    "max_replica": 123,
    "autoscaling_window": 123,
    "scale_down_delay": 123,
    "concurrency_target": 123
  },
  "promotion_settings": {
    "redeploy_on_promotion": true,
    "ramp_up_while_promoting": true,
    "ramp_up_duration_seconds": 600
  },
  "instance_type": {
    "id": "<string>",
    "name": "<string>",
    "memory_limit_mib": 123,
    "millicpu_limit": 123,
    "gpu_count": 123,
    "gpu_type": "<string>",
    "gpu_memory_limit_mib": 123
  }
}

Authorizations

Authorization
string
header
required

You must specify the scheme 'Api-Key' in the Authorization header. For example, Authorization: Api-Key <Your_Api_Key>

Path Parameters

model_id
string
required

Body

application/json

A request to create an environment.

name
string
required

Name of the environment

Example:

"staging"

autoscaling_settings
object | null

Autoscaling settings for the environment

Example:
{
  "autoscaling_window": 800,
  "concurrency_target": 3,
  "max_replica": 2,
  "min_replica": 1,
  "scale_down_delay": 60
}
promotion_settings
object | null

Promotion settings for the environment

Example:
{
  "ramp_up_duration_seconds": 600,
  "ramp_up_while_promoting": true,
  "redeploy_on_promotion": true
}

Response

200 - application/json

Environment for oracles.

name
string
required

Name of the environment

created_at
string
required

Time the environment was created in ISO 8601 format

model_id
string
required

Unique identifier of the model

current_deployment
object | null
required

Current deployment of the environment

autoscaling_settings
object
required

Autoscaling settings for the environment

promotion_settings
object
required

Promotion settings for the environment

instance_type
object
required

Instance type for the environment