Environments
Create Chain environment
Environments
Create Chain environment
Create a chain environment. Returns the resulting environment.
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
You must specify the scheme 'Api-Key' in the Authorization header. For example, Authorization: Api-Key <Your_Api_Key>
Path Parameters
Body
application/json
A request to create a custom environment for a chain.
Response
200 - application/json
Environment for oracles.
Was this page helpful?
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"
}
}