跳转到内容
EN

读取模板及构建

GET/e2b/templates/{templateID}● 支持

请求参数

  • templateIDstring必填

    path:

  • nextTokenstring可选

    query: Cursor to start the list from

  • limitinteger可选
    默认 100

    query: Maximum number of items to return per page

返回

200

错误按 E2B 格式返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/e2b/templates/sbe_example \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
import requests

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("GET", opts["api_url"] + "/templates/sbe_example",
    headers={"X-API-Key": opts["api_key"]},
)
print(resp.status_code, resp.text)
TypeScript
const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch(opts.apiUrl + "/templates/sbe_example", { method: "GET",
  headers: { "X-API-Key": opts.apiKey },
});
console.log(resp.status, await resp.text());

响应示例 200

{
  "templateID": "sbe_316095347ee129f46013",
  "public": false,
  "names": [
    "docs-template-2734c250"
  ],
  "aliases": [],
  "createdAt": "2026-10-29T07:58:01.891Z",
  "updatedAt": "2026-10-29T07:58:32.042Z",
  "lastSpawnedAt": null,
  "spawnCount": 0,
  "builds": [
    {
      "buildID": "sbt_e2d426b9-49b3-4082-ace8-ef369dd78c07",
      "status": "ready",
      "createdAt": "2026-10-29T07:58:01.891Z",
      "updatedAt": "2026-10-29T07:58:32.042Z",
      "finishedAt": "2026-10-29T07:58:32.042Z",
      "cpuCount": 2,
      "memoryMB": 1024,
      "diskSizeMB": 10240
    }
  ]
}

响应

HTTP 200

Successfully returned the template with its builds

application/json

名称 类型 说明
templateID string Identifier of the template
public boolean Whether the template is public or only accessible by the team
aliases array<string> Aliases of the template
names array<string> Names of the template (namespace/alias format when namespaced)
createdAt string Time when the template was created
updatedAt string Time when the template was last updated
lastSpawnedAt string Time when the template was last used
spawnCount integer Number of times the template was used
builds array<object> List of builds for the template
builds[].buildID string Identifier of the build
builds[].status string Status of the template build
builds[].createdAt string Time when the build was created
builds[].updatedAt string Time when the build was last updated
builds[].finishedAt string Time when the build was finished
builds[].cpuCount integer CPU cores for the sandbox
builds[].memoryMB integer Memory for the sandbox in MiB
builds[].diskSizeMB integer Disk size for the sandbox in MiB
builds[].envdVersion string Version of the envd running in the sandbox