GET
/
gpu-instance
/
openapi
/
v1
/
templates
List Templates
curl --request GET \
  --url https://api.novita.ai/gpu-instance/openapi/v1/templates \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'
{
  "template": [
    {
      "Id": "<string>",
      "createTime": "<string>",
      "user": "<string>",
      "tools": [
        "<string>"
      ],
      "name": "<string>",
      "readme": "<string>",
      "type": "<string>",
      "channel": "<string>",
      "image": "<string>",
      "imageAuth": "<string>",
      "startCommand": "<string>",
      "rootfsSize": 123,
      "volumes": [
        {
          "type": "<string>",
          "size": 123,
          "mountPath": "<string>"
        }
      ],
      "ports": [
        {
          "type": "<string>",
          "ports": {}
        }
      ],
      "envs": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ]
    }
  ],
  "pageSize": 123,
  "pageNum": 123,
  "total": 123
}

Request Headers

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Query Parameters

pageSize
integer
Maximum number of entries returned on one page.
pageNum
integer
Current page index.
name
string
Filter the templates by name.
type
string
Filter the templates by type.
channel
string[]
Filter the templates by channel.

Response

template
object[]
pageSize
integer
Maximum number of entries returned on one page.
pageNum
integer
Current page index.
total
integer
Total number of templates.

Example

Request
curl --request GET \
  --url 'https://api.novita.ai/gpu-instance/openapi/v1/templates' \
  --header 'Authorization: Bearer {{API Key}}'
Response
{
  "template": [
    {
      "Id": "100",
      "user": "1032922317920824",
      "name": "name",
      "readme": "```\nreadme\n```\n# uiohiu\n68686",
      "logo": "",
      "type": "instance",
      "channel": "private",
      "image": "image",
      "imageAuth": "",
      "startCommand": "startCommand",
      "rootfsSize": 10,
      "volumes": [
        {
          "type": "local",
          "size": 20,
          "mountPath": "localVolumeMount"
        }
      ],
      "ports": [
        {
          "type": "tcp",
          "ports": [8080, 8090]
        },
        {
          "type": "http",
          "ports": [6000, 60001]
        }
      ],
      "envs": [
        {
          "key": "testkey",
          "value": "123"
        }
      ],
      "tools": [],
      "createTime": "1711995567"
    }
  ],
  "pageSize": 1,
  "pageNum": 0,
  "total": 10
}