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
| Parameter | Required | Type | Description |
|---|---|---|---|
templateCode | Yes | string | Unique 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
| Field | Type | Description |
|---|---|---|
templateID | string | Template ID. |
templateName | string | Template name. |
cpuCount | integer | Number of vCPUs. |
memoryMB | integer | Memory size in MB. |
public | boolean | Whether the template is public. |
imageName | string | Image display name. |
createdAt | string | Creation time in date-time format. |
updatedAt | string | Update time in date-time format. |
spawnCount | integer | Number of instances of the template. |
buildCount | integer | Number of template versions. |
envdVersion | string | envd version. |
builds | array<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). |
Is this page helpful?