跳转到主要内容
GET
/
gpus
/
v2
/
templates
查询模板列表
curl --request GET \
  --url https://api.ppio.com/gpus/v2/templates \
  --header 'Authorization: <authorization>'
{
  "data": [
    {
      "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": "<string>",
      "command": "",
      "entrypoint": "<string>",
      "rootfs_size_gb": 50,
      "ports": [
        {
          "protocol": "http",
          "port": 8888
        }
      ],
      "envs": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ],
      "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"
    }
  ],
  "next_cursor": "eyJvZmZzZXQiOjIwfQ",
  "has_more": true
}

请求头

Authorization
string
必填

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

查询参数

limit
integer

单页条数。整数,取值 >= 0。

cursor
string

游标,首次请求留空。透传上次响应的 next_cursor。字符串,长度限制:0-1024 字符。

name
string

模板名称搜索。字符串,长度限制:0-255 字符。

type
string

模板类型过滤。

visibilities
string

可见性过滤,多个用英文逗号分隔。

member_ids
string

创建成员 ID 过滤,多个用英文逗号分隔。字符串,长度限制:0-255 字符。

is_my_community
boolean

是否仅查询我的社区模板。

响应

200 - application/json

查询成功

data
object[]

模板列表

next_cursor
string

下一页游标。has_more=false 时为空字符串

示例:

"eyJvZmZzZXQiOjIwfQ"

has_more
boolean

是否还有下一页

示例:

true

最后修改于 2026年6月22日