v1
latestOpenAPI 3.1.02026-07-2676123203.9 KBServerless
Create a serverless endpoint
Creates a serverless endpoint. Specify gpu for compute (CPU serverless endpoints are read-only). Container settings can be spread from a template response — see CreateEndpointRequest for the full body.
Returns 201 with the created endpoint. The endpoint can accept jobs immediately, but starts with no active workers unless workers.min is greater than 0. Workers are provisioned on demand and autoscaled between workers.min and workers.max according to the scaling policy, so the first request to an idle endpoint may incur cold-start latency while a worker pulls its image and boots.
post/v2/serverless
Request body
Example request
{
"image": "runpod/pytorch:2.8.0-py3.11-cuda12.8.1",
"disk": 50,
"ports": [
"8888/http",
"22/tcp"
],
"env": {
"JUPYTER_PASSWORD": "hunter2"
},
"name": "my-inference",
"gpu": {
"pools": [
"ADA_24"
],
"count": 1
}
}Response
Created
Example response
{
"computeType": "GPU",
"createdAt": "2024-07-12T19:14:40.144Z",
"env": {
"ENV_VAR": "value"
},
"executionTimeoutMs": 600000,
"gpuCount": 1,
"id": "jpnw0v75y3qoql",
"idleTimeout": 5,
"instanceIds": [
"cpu3c-8-16"
],
"name": "my endpoint",
"networkVolumeId": "agv6w2qcg7",
"networkVolumeIds": [
"agv6w2qcg7",
"bxh7w3rch8"
],
"scalerType": "QUEUE_DELAY",
"scalerValue": 4,
"template": {
"category": "NVIDIA",
"containerDiskInGb": 50,
"dockerEntrypoint": [],
"dockerStartCmd": [],
"earned": 100,
"env": {
"ENV_VAR": "value"
},
"id": "30zmvf89kd",
"imageName": "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
"isRunpod": true,
"isServerless": true,
"name": "my template",
"ports": [
"8888/http",
"22/tcp"
],
"volumeInGb": 20,
"volumeMountPath": "/workspace"
},
"templateId": "30zmvf89kd",
"userId": "user_2PyTJrLzeuwfZilRZ7JhCQDuSqo",
"workers": [
{
"adjustedCostPerHr": 0.69,
"consumerUserId": "user_2PyTJrLzeuwfZilRZ7JhCQDuSqo",
"containerDiskInGb": 50,
"containerRegistryAuthId": "clzdaifot0001l90809257ynb",
"cpuFlavorId": "cpu3c",
"env": {
"ENV_VAR": "value"
},
"gpu": {
"count": 1
},
"id": "xedezhzb9la3ye",
"image": "runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04",
"lastStartedAt": "2024-07-12T19:14:40.144Z",
"lastStatusChange": "Rented by User: Fri Jul 12 2024 15:14:40 GMT-0400 (Eastern Daylight Time)",
"machine": {
"gpuType": {
"count": 1
}
},
"machineId": "s194cr8pls2z",
"memoryInGb": 62,
"networkVolume": {
"id": "agv6w2qcg7",
"name": "my network volume",
"size": 50,
"dataCenterId": "EU-RO-1"
},
"portMappings": {
"22": 10341
},
"ports": [
"8888/http",
"22/tcp"
],
"publicIp": "100.65.0.119",
"savingsPlans": [
{
"costPerHr": 0.21,
"endTime": "2024-07-12T19:14:40.144Z",
"gpuTypeId": "NVIDIA GeForce RTX 4090",
"id": "clkrb4qci0000mb09c7sualzo",
"podId": "xedezhzb9la3ye",
"startTime": "2024-05-12T19:14:40.144Z"
}
],
"vcpuCount": 24,
"volumeInGb": 20,
"volumeMountPath": "/workspace"
}
],
"workersMax": 3
}