跳转到主要内容
POST
/
gpus
/
v2
/
endpoints
创建 Endpoint
curl --request POST \
  --url https://api.ppio.com/gpus/v2/endpoints \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "type": "sync",
  "name": "example-endpoint",
  "product_id": "product-id",
  "image": "registry.example.com/namespace/image:tag",
  "worker_config": {
    "max_replicas": 2,
    "min_replicas": 0,
    "idle_timeout": 300,
    "max_concurrent_per_worker": 10,
    "gpu_num": 1,
    "rootfs_size_gb": 20,
    "min_cuda_version": "12.4",
    "request_timeout": 60
  },
  "app_name": "example-app",
  "registry_auth_id": "registry-auth-id",
  "entrypoint": "",
  "command": "",
  "policy": {
    "type": "queue",
    "value": 100
  },
  "volumes": [
    {
      "id": "storage-id",
      "type": "network",
      "size": 123,
      "mount_point": "/data"
    }
  ],
  "envs": [
    {
      "key": "ENV_NAME",
      "value": "ENV_VALUE"
    }
  ],
  "ports": [
    8080
  ],
  "health_check": {
    "path": "/healthz",
    "port": 8080
  },
  "region_id": "region-id"
}
'
{
  "id": "endpoint-id"
}

请求头

Content-Type
string
必填

枚举值:application/json。

Authorization
string
必填

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

请求体

application/json
type
enum<string>
必填

Endpoint 类型

可用选项:
sync,
async
示例:

"sync"

name
string
必填

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

示例:

"example-endpoint"

product_id
string
必填

Serverless 产品 ID。字符串,长度限制:1-255 字符。

示例:

"product-id"

image
string
必填

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

示例:

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

worker_config
object
必填

Worker 配置。

app_name
string

应用名称。字符串,长度限制:0-255 字符。

示例:

"example-app"

registry_auth_id
string

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

示例:

"registry-auth-id"

entrypoint
string

容器 entrypoint。

示例:

""

command
string

启动命令。

示例:

""

policy
object

调度/请求策略。

volumes
object[]

挂载卷列表。

envs
object[]

环境变量列表。

ports
integer[]

端口号列表。每项取值范围:[1, 65535]。

示例:
[8080]
health_check
object

健康检查配置。

region_id
string

区域 ID。

示例:

"region-id"

响应

200 - application/json

创建成功

id
string

创建成功后的 Endpoint ID

示例:

"endpoint-id"

最后修改于 2026年6月22日