curl --request POST \
--url https://api.baseten.co/v1/chains/{chain_id}/environments \
--header "Authorization: Api-Key $BASETEN_API_KEY" \
--data '{
  "name": "staging",
  "promotion_settings": {
    "ramp_up_duration_seconds": 600,
    "ramp_up_while_promoting": true,
    "redeploy_on_promotion": true
  },
  "chainlet_settings": [
    {
      "autoscaling_settings": {
        "autoscaling_window": 800,
        "concurrency_target": 4,
        "max_replica": 3,
        "min_replica": 2,
        "scale_down_delay": 63
      },
      "chainlet_name": "HelloWorld",
      "instance_type_id": "2x8"
    },
    {
      "autoscaling_settings": {
        "autoscaling_window": null,
        "concurrency_target": null,
        "max_replica": 3,
        "min_replica": 3,
        "scale_down_delay": null
      },
      "chainlet_name": "RandInt",
      "instance_type_id": "A10Gx8x32"
    }
  ]
}'
{
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "chain_id": "<string>",
  "promotion_settings": {
    "redeploy_on_promotion": true,
    "ramp_up_while_promoting": true,
    "ramp_up_duration_seconds": 600
  },
  "chainlet_settings": [
    {
      "chainlet_name": "<string>",
      "autoscaling_settings": {
        "min_replica": 123,
        "max_replica": 123,
        "autoscaling_window": 123,
        "scale_down_delay": 123,
        "concurrency_target": 123
      },
      "instance_type": {
        "id": "<string>",
        "name": "<string>",
        "memory_limit_mib": 123,
        "millicpu_limit": 123,
        "gpu_count": 123,
        "gpu_type": "<string>",
        "gpu_memory_limit_mib": 123
      }
    }
  ],
  "current_deployment": {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "chain_id": "<string>",
    "environment": "<string>",
    "chainlets": [
      {
        "id": "<string>",
        "name": "<string>",
        "autoscaling_settings": {
          "min_replica": 123,
          "max_replica": 123,
          "autoscaling_window": 123,
          "scale_down_delay": 123,
          "concurrency_target": 123
        },
        "instance_type_name": "<string>",
        "active_replica_count": 123,
        "status": "BUILDING"
      }
    ],
    "status": "BUILDING"
  }
}

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

chain_id
string
required

Body

application/json

A request to create a custom environment for a chain.

name
string
required

Name of the environment

Example:

"staging"

promotion_settings
object | null

Promotion settings for the environment

Example:
{
  "ramp_up_duration_seconds": 600,
  "ramp_up_while_promoting": true,
  "redeploy_on_promotion": true
}
chainlet_settings
object[] | null

Mapping of chainlet name to the desired chainlet environment settings

Request to create environment settings for a chainlet.

Example:
[
  {
    "autoscaling_settings": {
      "autoscaling_window": 800,
      "concurrency_target": 4,
      "max_replica": 3,
      "min_replica": 2,
      "scale_down_delay": 63
    },
    "chainlet_name": "HelloWorld",
    "instance_type_id": "2x8"
  },
  {
    "autoscaling_settings": {
      "autoscaling_window": null,
      "concurrency_target": null,
      "max_replica": 3,
      "min_replica": 3,
      "scale_down_delay": null
    },
    "chainlet_name": "RandInt",
    "instance_type_id": "A10Gx8x32"
  }
]

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

chain_id
string
required

Unique identifier of the chain

promotion_settings
object
required

Promotion settings for the environment

chainlet_settings
object[]
required

Environment settings for the chainlets

Environment settings for a chainlet.

current_deployment
object | null
required

Current chain deployment of the environment