Skip to main content
GET
https://api.novita.ai
/
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>",
      "name": "<string>",
      "readme": "<string>",
      "type": "<string>",
      "channel": "<string>",
      "image": "<string>",
      "imageAuth": "<string>",
      "startCommand": "<string>",
      "entrypoint": "<string>",
      "rootfsSize": 123,
      "ports": [
        {
          "type": "<string>",
          "ports": {}
        }
      ],
      "envs": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ],
      "tools": [
        {
          "name": "<string>",
          "describe": "<string>",
          "port": 123,
          "type": "<string>"
        }
      ],
      "createdAt": "<string>",
      "recommendCards": [
        {
          "gpuSpecId": "<string>",
          "cardNum": "<string>"
        }
      ],
      "minCudaVersion": "<string>"
    }
  ],
  "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
Page size. Integer, value >= 0.
pageNum
integer
Page number. Integer, value >= 0.
name
string
Filter the templates by name (fuzzy match). String, length limit: 1-255 characters.
type
string
Filter the templates by type.
channel
string
required
Filter the templates by channel.
Enum: official, community, private
isMyCommunity
boolean
required
Template visibility scope. Values: true, false.
Note:
  • Query official/community templates: set to false
  • Query private templates: set to true

Response

template
object[]
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",
      "name": "name",
      "readme": "```\nreadme\n```\n# uiohiu\n68686",
      "type": "instance",
      "channel": "official",
      "image": "image",
      "imageAuth": "",
      "startCommand": "startCommand",
      "entrypoint": "",
      "rootfsSize": 10,
      "ports": [
        {
          "type": "tcp",
          "ports": [8080, 8090]
        },
        {
          "type": "http",
          "ports": [6000, 60001]
        }
      ],
      "envs": [
        {
          "key": "testkey",
          "value": "123"
        }
      ],
      "tools": [
        {
          "name": "Jupyter",
          "describe": "Start Jupyter Notebook",
          "port": 8888,
          "type": "http"
        }
      ],
      "createdAt": "1711995567",
      "recommendCards": [
        {
          "gpuSpecId": "4090.18c.60g",
          "cardNum": "2"
        }
      ],
      "minCudaVersion": "11.8"
    }
  ],
  "total": 10
}