> ## Documentation Index
> Fetch the complete documentation index at: https://ppio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询模板列表



## OpenAPI

````yaml gpus/v2-spec/list-templates.json GET /gpus/v2/templates
openapi: 3.0.0
info:
  title: PPIO GPU API v2
  version: 2.0.0
servers:
  - url: https://api.ppio.com
security: []
paths:
  /gpus/v2/templates:
    get:
      summary: 查询模板列表
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
          description: Bearer 身份验证格式，例如：Bearer `{{API 密钥}}`。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: 单页条数。整数,取值 >= 0。
          example: 20
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: 游标,首次请求留空。透传上次响应的 `next_cursor`。字符串,长度限制:0-1024 字符。
        - name: name
          in: query
          required: false
          schema:
            type: string
          description: 模板名称搜索。字符串,长度限制:0-255 字符。
          example: pytorch
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: 模板类型过滤。
          example: instance
        - name: visibilities
          in: query
          required: false
          schema:
            type: string
          description: 可见性过滤,多个用英文逗号分隔。
        - name: member_ids
          in: query
          required: false
          schema:
            type: string
          description: 创建成员 ID 过滤,多个用英文逗号分隔。字符串,长度限制:0-255 字符。
        - name: is_my_community
          in: query
          required: false
          schema:
            type: boolean
          description: 是否仅查询我的社区模板。
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: 模板列表
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: 模板 ID
                          example: tpl-001
                        owner_id:
                          type: string
                          description: 所属用户 ID
                          example: owner-001
                        name:
                          type: string
                          description: 模板名称
                          example: pytorch-2.3-cuda12
                        type:
                          type: string
                          description: 模板类型
                          example: instance
                        visibility:
                          type: string
                          description: 可见性
                          example: community
                        image:
                          type: string
                          description: 镜像地址
                          example: registry.example.com/ml/pytorch:2.3-cuda12
                        registry_auth_id:
                          type: string
                          description: 镜像仓库认证 ID
                        command:
                          type: string
                          description: 启动命令
                          example: ''
                        entrypoint:
                          type: string
                          description: 镜像入口命令
                        rootfs_size_gb:
                          type: integer
                          description: 系统盘大小。单位为 GB
                          example: 50
                        ports:
                          type: array
                          description: 暴露端口配置
                          items:
                            type: object
                            properties:
                              protocol:
                                type: string
                                description: 协议或端口类型
                                example: http
                              port:
                                type: integer
                                description: 端口
                                example: 8888
                        envs:
                          type: array
                          description: 环境变量
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                description: 环境变量名
                              value:
                                type: string
                                description: 环境变量值
                        metadata:
                          type: object
                          description: 模板元数据
                          properties:
                            readme:
                              type: string
                              description: 模板说明
                              example: PyTorch 2.3 with CUDA 12
                            logo:
                              type: string
                              description: 图标 URL
                              example: https://example.com/logo.png
                            description:
                              type: string
                              description: 简短描述
                              example: PyTorch development template
                            author:
                              type: string
                              description: 作者
                              example: PAI
                            tags:
                              type: array
                              items:
                                type: string
                              description: 标签
                              example:
                                - pytorch
                                - cuda
                        min_cuda_version:
                          type: string
                          description: 最低 CUDA 版本
                          example: '12.2'
                        created_at:
                          type: integer
                          description: 创建时间。Unix 时间戳
                          example: 1715750400
                        updated_at:
                          type: integer
                          description: 更新时间。Unix 时间戳
                          example: 1715750400
                        member_id:
                          type: string
                          description: 创建成员 ID
                          example: 550e8400-e29b-41d4-a716-446655440000
                  next_cursor:
                    type: string
                    description: 下一页游标。`has_more=false` 时为空字符串
                    example: eyJvZmZzZXQiOjIwfQ
                  has_more:
                    type: boolean
                    description: 是否还有下一页
                    example: true

````