Get template

Updated at:

Retrieve the detailed configuration of a specific template, including resource specifications, instance count, version count, and current build information.

Prerequisites

Configure the endpoint and authentication first. See API overview and authentication.

Endpoint

GET /templates/{templateCode}

Retrieve the detailed configuration of a specific template. Returns 404 if the template does not exist, with the message 沙箱模版不存在 (the sandbox template does not exist).

Path parameters

ParameterRequiredTypeDescription
templateCodeYesstringUnique template code.

Request example

curl -X GET "$BASE_URL/templates/your-template-id" \
  -H "Authorization: Bearer $BAILIAN_API_KEY"

BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sandbox, and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.

Response example

{
  "templateID": "your-template-id",
  "templateName": "my-template",
  "cpuCount": 1,
  "memoryMB": 2048,
  "public": false,
  "imageName": "your-image-name",
  "createdAt": "2026-01-01T00:00:00Z",
  "updatedAt": "2026-01-01T00:00:00Z",
  "spawnCount": 2,
  "buildCount": 1,
  "envdVersion": "your-envd-version",
  "builds": [
    {
      "buildID": "your-build-id",
      "status": "ready",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z",
      "finishedAt": "2026-01-01T00:00:00Z",
      "cpuCount": 1,
      "memoryMB": 2048,
      "diskSizeMB": 10240,
      "envdVersion": "your-envd-version"
    }
  ]
}

Response fields

FieldTypeDescription
templateIDstringTemplate ID.
templateNamestringTemplate name.
cpuCountintegerNumber of vCPUs.
memoryMBintegerMemory size in MB.
publicbooleanWhether the template is public.
imageNamestringImage display name.
createdAtstringCreation time in date-time format.
updatedAtstringUpdate time in date-time format.
spawnCountintegerNumber of instances of the template.
buildCountintegerNumber of template versions.
envdVersionstringenvd version.
buildsarray<object>Build information for the current version. Sub-fields: buildID (string, build ID), status (string, build status, for example building, ready, or error), createdAt (string, build creation time), updatedAt (string, build update time), finishedAt (string, build completion time; omitted when an accurate value is unavailable), cpuCount (integer, number of vCPUs), memoryMB (integer, memory size in MB), diskSizeMB (integer, disk size in MB), envdVersion (string, envd version).