GET
/
gpu-instance
/
openapi
/
v1
/
template
curl --request GET \
  --url https://api.novita.ai/gpu-instance/openapi/v1/template \
  --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>"
      }
    ]
  }
}

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

Bearer authentication format, for example: Bearer {{API Key}}.

Query Parameters

templateId
string

ID of the template being queried.

Response

template
object

Template settings.

Example

Request

curl --request GET \
  --url 'https://api.novita.ai/gpu-instance/openapi/v1/template' \
  --header 'Authorization: Bearer {{API Key}}'

Response

{
  "template": {
    "Id": "212",
    "user": "9141320498493177",
    "name": "ubuntu",
    "readme": "readme",
    "logo": "",
    "type": "instance",
    "channel": "private",
    "image": "ubuntu:latest",
    "imageAuth": "",
    "startCommand": "",
    "rootfsSize": 10,
    "volumes": [
      {
        "type": "local",
        "size": 20,
        "mountPath": "/workspace"
      }
    ],
    "ports": [
      {
        "type": "tcp",
        "ports": [8080, 8090]
      },
      {
        "type": "http",
        "ports": [6000, 60001]
      }
    ],
    "envs": [
      {
        "key": "testkey",
        "value": "123"
      }
    ],
    "tools": [],
    "createTime": "1713162260"
  }
}