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

templateCodestringRequired

Unique template code.

Response fields

templateIDstring

Template ID.

templateNamestring

Template name.

cpuCountinteger

Number of vCPUs.

memoryMBinteger

Memory size in MB.

publicboolean

Whether the template is public.

imageNamestring

Image display name.

createdAtstring

Creation time in date-time format.

updatedAtstring

Update time in date-time format.

spawnCountinteger

Number of instances of the template.

buildCountinteger

Number of template versions.

envdVersionstring

envd 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).

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"
    }
  ]
}