跳转到主要内容
POST
/
gpus
/
v2
/
instances
创建实例
curl --request POST \
  --url https://api.ppio.com/gpus/v2/instances \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "name": "example-instance",
  "product_id": "product-id",
  "image": "registry.example.com/namespace/image:tag",
  "billing": {
    "mode": "prepaid"
  },
  "resource": {
    "rootfs_size_gb": 20,
    "gpu_num": 1,
    "min_cuda_version": ""
  },
  "registry_auth_id": "registry-auth-id",
  "entrypoint": "",
  "command": "",
  "envs": [
    {
      "key": "ENV_NAME",
      "value": "ENV_VALUE"
    }
  ],
  "ports": [
    {
      "port": 8080,
      "protocol": "tcp"
    }
  ],
  "network": {
    "id": "vpc-550e8400-e29b-41d4-a716-446655440000",
    "ip": "10.2.1.1"
  },
  "volumes": [
    {
      "type": "network",
      "id": "network-storage-id",
      "mount_point": "/data"
    }
  ],
  "candidate_regions": [
    "region-id"
  ],
  "tools": {
    "jupyter": {
      "enabled": true,
      "port": 8888,
      "protocol": "http"
    }
  },
  "auto_migrate": {
    "enabled": false,
    "include_system_disk": false
  }
}
'
{
  "id": "ca338f12f3"
}

请求头

Content-Type
string
必填

枚举值:application/json。

Authorization
string
必填

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

请求体

application/json
name
string
必填

实例名称。字符串,长度限制:1-255 字符。

示例:

"example-instance"

product_id
string
必填

产品 ID。

示例:

"product-id"

image
string
必填

镜像地址。字符串,长度限制:1-500 字符。

示例:

"registry.example.com/namespace/image:tag"

billing
object
必填

计费配置。

resource
object
必填

资源配置。

type
enum<string>

实例类型。可选值:gpucpu。默认值:gpu

可用选项:
gpu,
cpu
registry_auth_id
string

已保存的镜像认证 ID。字符串,长度限制:0-255 字符。

示例:

"registry-auth-id"

entrypoint
string

容器 entrypoint。

示例:

""

command
string

容器启动命令。

示例:

""

envs
object[]

环境变量列表。

ports
object[]

暴露端口列表。

network
object

VPC 网络配置。

volumes
object[]

数据盘/网络存储挂载列表。

candidate_regions
string[]

候选调度区域列表。最终只会调度到其中一个区域。

示例:
["region-id"]
tools
object

实例工具配置。当前仅支持 Jupyter。

auto_migrate
object

自动迁移配置。

响应

200 - application/json

创建成功

id
string

创建成功后的实例 ID

示例:

"ca338f12f3"

最后修改于 2026年6月22日