跳转到主要内容
GET
/
gpus
/
v2
/
templates
/
{template_id}
查询模板详情
curl --request GET \
  --url https://api.ppio.com/gpus/v2/templates/{template_id} \
  --header 'Authorization: <authorization>'
{
  "id": "tpl-001",
  "owner_id": "owner-001",
  "name": "pytorch-2.3-cuda12",
  "type": "instance",
  "visibility": "community",
  "image": "registry.example.com/ml/pytorch:2.3-cuda12",
  "registry_auth_id": "auth-001",
  "command": "",
  "entrypoint": "/bin/bash",
  "rootfs_size_gb": 50,
  "ports": [
    {
      "protocol": "http",
      "port": 8888
    }
  ],
  "envs": [
    {
      "key": "ENV",
      "value": "prod"
    }
  ],
  "metadata": {
    "readme": "PyTorch 2.3 with CUDA 12",
    "logo": "https://example.com/logo.png",
    "description": "PyTorch development template",
    "author": "PAI",
    "tags": [
      "pytorch",
      "cuda"
    ]
  },
  "min_cuda_version": "12.2",
  "created_at": 1715750400,
  "updated_at": 1715750400,
  "member_id": "550e8400-e29b-41d4-a716-446655440000"
}

请求头

Authorization
string
必填

Bearer 身份验证格式,例如:Bearer {{API 密钥}}

路径参数

template_id
string
必填

模板 ID。字符串,长度限制:1-255 字符。

查询参数

is_community
boolean

是否查询社区模板。

响应

200 - application/json

成功

id
string

模板 ID

示例:

"tpl-001"

owner_id
string

所属用户 ID

示例:

"owner-001"

name
string

模板名称

示例:

"pytorch-2.3-cuda12"

type
string

模板类型

示例:

"instance"

visibility
string

可见性

示例:

"community"

image
string

镜像地址

示例:

"registry.example.com/ml/pytorch:2.3-cuda12"

registry_auth_id
string

镜像仓库认证 ID

示例:

"auth-001"

command
string

启动命令

示例:

""

entrypoint
string

镜像入口命令

示例:

"/bin/bash"

rootfs_size_gb
integer

系统盘大小。单位为 GB

示例:

50

ports
object[]

暴露端口配置

envs
object[]

环境变量

metadata
object

模板元数据

min_cuda_version
string

最低 CUDA 版本

示例:

"12.2"

created_at
integer

创建时间。Unix 时间戳

示例:

1715750400

updated_at
integer

更新时间。Unix 时间戳

示例:

1715750400

member_id
string

创建成员 ID

示例:

"550e8400-e29b-41d4-a716-446655440000"

最后修改于 2026年6月22日