Skip to main content
GET
/
v1
/
chains
/
{chain_id}
/
environments
/
{env_name}
cURL
curl --request GET \
--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name} \
--header "Authorization: Bearer $BASETEN_API_KEY"
import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}"

headers = {"Authorization": f"Bearer {API_KEY}"}

response = requests.request(
"GET",
url,
headers=headers,
json={}
)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "chain_id": "<string>",
  "promotion_settings": {
    "redeploy_on_promotion": true,
    "rolling_deploy": true,
    "promotion_cleanup_strategy": "SCALE_TO_ZERO",
    "rolling_deploy_config": {
      "rolling_deploy_strategy": "REPLICA",
      "max_surge_percent": 25,
      "max_unavailable_percent": 0,
      "stabilization_time_seconds": 0,
      "replica_overhead_percent": 0
    },
    "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,
        "target_utilization_percentage": 123,
        "target_in_flight_tokens": 123,
        "max_scale_down_rate": 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,
          "target_utilization_percentage": 123,
          "target_in_flight_tokens": 123,
          "max_scale_down_rate": 123
        },
        "instance_type_name": "<string>",
        "active_replica_count": 123
      }
    ]
  },
  "candidate_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,
          "target_utilization_percentage": 123,
          "target_in_flight_tokens": 123,
          "max_scale_down_rate": 123
        },
        "instance_type_name": "<string>",
        "active_replica_count": 123
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Path Parameters

chain_id
string
required
env_name
string
required

Response

200 - application/json

Environment for oracles.

name
string
required

Name of the environment

created_at
string<date-time>
required

Time the environment was created in ISO 8601 format

chain_id
string
required

Unique identifier of the chain

promotion_settings
PromotionSettingsV1 · object
required

Promotion settings for the environment

chainlet_settings
ChainletEnvironmentSettingsV1 · object[]
required

Environment settings for the chainlets

current_deployment
ChainDeploymentV1 · object | null
required

Current chain deployment of the environment

candidate_deployment
ChainDeploymentV1 · object | null

Candidate chain deployment being promoted to the environment, if a promotion is in progress