Docs / API reference
Pods A pod is a dedicated GPU container billed per second while it runs. Use these endpoints to manage the full pod lifecycle .
Name Type Description idstring Unique ID, prefixed pod_. objectstring Always pod. namestring Display name, 1 to 64 characters. statusenum Observed state: CREATED, PROVISIONING, RUNNING, EXITED, TERMINATED. desiredStatusenum Target state the platform is driving towards: RUNNING, EXITED or TERMINATED. imagestring Docker image reference, e.g. apipods/pytorch:2.9.0-py3.12-cuda12.8.1. gpuTypeIdstring Full GPU type ID, e.g. NVIDIA_H100_80GB_SXM. See GPU types. gpuCountinteger Number of GPUs attached to the pod. regionIdstring Region the pod runs in, e.g. eu-nl-1. vcpuCountinteger vCPUs allocated (scales with gpuCount). memoryInGbinteger System RAM allocated (scales with gpuCount). containerDiskInGbinteger Size of the ephemeral container disk. Wiped on stop. volumeInGbinteger Size of the persistent volume disk. 0 means no volume disk. volumeMountPathstring Where the volume disk or network volume is mounted. Default /workspace. networkVolumeIdstring | null Attached network volume (vol_…). Replaces the volume disk at volumeMountPath. templateIdstring | null Template the pod was created from, if any. startCommandstring | null Overrides the image's CMD. null uses the image default. portsarray Exposed ports. HTTP ports have a url; TCP ports have publicIp and publicPort while running. envobject Environment variables. Values may reference secrets as {{ secrets.NAME }}; references are returned unresolved. costPerHrnumber Current hourly cost in USD for GPU and disks while running. lastExitCodeinteger | null Exit code of the container's main process the last time it stopped. createdAtstring ISO 8601 timestamp. startedAtstring | null When the pod last entered RUNNING. updatedAtstring ISO 8601 timestamp of the last change.
pod object Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "RUNNING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T09:14:41Z"
}GET /pods
Returns pods in your organization, newest first. Terminated pods are listed for 30 days.
Parameters Name In Type Description statusquery enum Filter by status. gpuTypeIdquery string Filter by GPU type. regionIdquery string Filter by region. limitquery integer 1 to 100, default 20. See Pagination. cursorquery string Cursor from a previous page.
Request curl https://api.apipods.com/v1/pods?status=RUNNING&limit=20 \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"object" : "list" ,
"data" : [
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "RUNNING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T09:14:41Z"
}
],
"hasMore" : false ,
"nextCursor" : null
}POST /pods
Creates a pod and starts scheduling it. The response returns immediately with status: "CREATED"; the pod moves to PROVISIONING and then RUNNING, usually within a minute for cached images. Poll the pod, use wait_until_running() in the SDK, or subscribe to the pod.running webhook .
Parameters Name In Type Description namerequired body string Display name, 1 to 64 characters. gpuTypeIdrequired body string Full GPU type ID, e.g. NVIDIA_H100_80GB_SXM. Short aliases such as H100_SXM are accepted by the SDKs and CLI only. imagebody string Docker image. Required unless templateId is set. templateIdbody string Create from a template. Fields you also pass override the template's values. gpuCountbody integer Default 1. Maximum depends on the GPU type (maxGpuCount). regionIdbody string Region to place the pod in, e.g. eu-nl-1. Omit to use any region with capacity. Required when networkVolumeId is set and must match the volume's region. containerDiskInGbbody integer Default 20, maximum 500. volumeInGbbody integer Default 0 (no volume disk). Maximum 4000. volumeMountPathbody string Default /workspace. networkVolumeIdbody string Mount a network volume at volumeMountPath instead of a volume disk. portsbody array Up to 10 objects { "port": 8888, "protocol": "http" }. protocol is http or tcp. envbody object Up to 100 variables. Reference secrets as {{ secrets.NAME }}. startCommandbody string Override the image's CMD. registryCredentialIdbody string Credentials for pulling a private image (rcr_…). Idempotency-Keyheader string Recommended. See Idempotency.
Request curl -X POST https://api.apipods.com/v1/pods \
-H "Authorization: Bearer $APIPODS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 5f0c2c1e-8a4b-4f7e-9a61-0d2b7c3e9f14" \
-d '{
"name": "llama-finetune",
"gpuTypeId": "NVIDIA_H100_80GB_SXM",
"gpuCount": 1,
"image": "apipods/pytorch:2.9.0-py3.12-cuda12.8.1",
"regionId": "eu-nl-1",
"containerDiskInGb": 50,
"volumeInGb": 100,
"volumeMountPath": "/workspace",
"ports": [
{
"port": 8888,
"protocol": "http"
},
{
"port": 22,
"protocol": "tcp"
}
],
"env": {
"HF_HOME": "/workspace/hf",
"HF_TOKEN": "{{ secrets.HF_TOKEN }}"
}
}' Response 201 Created Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "CREATED" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : null ,
"publicPort" : null
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : null ,
"updatedAt" : "2026-11-18T09:14:02Z"
}Status When 400invalid_parameter, missing_parameter or unsupported_gpu_type.402insufficient_balance (balance must cover one hour of the pod) or spend_limit_reached.403gpu_quota_exceeded: the pod would exceed your GPU quota.503no_capacity: no free GPU of this type in the requested region and cloud type.
GET /pods/{podId}
Returns a single pod, including its current status, ports and cost.
Parameters Name In Type Description podIdrequired path string The pod ID.
Request curl https://api.apipods.com/v1/pods/pod_8f2k1x9q \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "RUNNING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T09:14:41Z"
}Status When 404resource_not_found.
PATCH /pods/{podId}
Changes a pod's configuration. Only the fields you send are changed; env and ports are replaced as a whole.
Warning: Changing image, env, ports or startCommand on a RUNNING pod restarts it to apply the change. The container disk is reset; the volume disk and network volume are kept.
Parameters Name In Type Description podIdrequired path string The pod ID. namebody string New display name. Applied immediately. imagebody string New image. Restarts a running pod. envbody object Replaces all environment variables. Restarts a running pod. portsbody array Replaces exposed ports. Restarts a running pod. startCommandbody string | null New start command, or null for the image default. Restarts a running pod. volumeInGbbody integer New volume disk size. Can only grow; applied online. containerDiskInGbbody integer Can only grow, and only while the pod is EXITED.
Request curl -X PATCH https://api.apipods.com/v1/pods/pod_8f2k1x9q \
-H "Authorization: Bearer $APIPODS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"env": {
"HF_HOME": "/workspace/hf",
"HF_TOKEN": "{{ secrets.HF_TOKEN }}",
"WANDB_PROJECT": "llama-finetune"
},
"volumeInGb": 200
}' Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "PROVISIONING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 200 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}" ,
"WANDB_PROJECT" : "llama-finetune"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T11:30:52Z"
}Status When 400invalid_parameter, e.g. shrinking volumeInGb.409invalid_state: the pod is TERMINATED, or containerDiskInGb was changed while not EXITED.
POST /pods/{podId}/start
Starts an EXITED pod on the same host, so the volume disk is available again. If all GPUs on that host are in use, the request fails with 503 no_capacity. Retry later, or keep data on a network volume so you can create a new pod on any host.
Parameters Name In Type Description podIdrequired path string The pod ID.
Request curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/start \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "PROVISIONING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : null ,
"updatedAt" : "2026-11-18T18:00:12Z"
}Status When 402insufficient_balance or spend_limit_reached.409invalid_state: the pod is not EXITED.503no_capacity: the pod's host has no free GPU of its type.
POST /pods/{podId}/stop
Stops the container with SIGTERM, followed by SIGKILL after 10 seconds. The GPU is released and GPU billing stops. The container disk is wiped; the volume disk is kept and billed at the stopped rate (see Pricing ).
Parameters Name In Type Description podIdrequired path string The pod ID.
Request curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/stop \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "EXITED" ,
"desiredStatus" : "EXITED" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : 0 ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T17:02:19Z"
}Status When 409invalid_state: the pod is not RUNNING or PROVISIONING.
POST /pods/{podId}/restart
Restarts the container without releasing the GPU. The container disk is preserved. Useful after a crash or to reload a changed start script.
Parameters Name In Type Description podIdrequired path string The pod ID.
Request curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/restart \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "PROVISIONING" ,
"desiredStatus" : "RUNNING" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [
{
"port" : 8888 ,
"protocol" : "http" ,
"url" : "https://8f2k1x9q-8888.proxy.apipods.net"
},
{
"port" : 22 ,
"protocol" : "tcp" ,
"publicIp" : "203.0.113.42" ,
"publicPort" : 40122
}
],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 8.78 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T12:04:33Z"
}Status When 409invalid_state: the pod is not RUNNING.
DELETE /pods/{podId}
Terminates the pod. The container disk and volume disk are deleted permanently and all billing for the pod stops. Attached network volumes are detached and kept.
Warning: Termination cannot be undone. Copy anything you need from the volume disk first.
Parameters Name In Type Description podIdrequired path string The pod ID.
Request curl -X DELETE https://api.apipods.com/v1/pods/pod_8f2k1x9q \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"id" : "pod_8f2k1x9q" ,
"object" : "pod" ,
"name" : "llama-finetune" ,
"status" : "TERMINATED" ,
"desiredStatus" : "TERMINATED" ,
"image" : "apipods/pytorch:2.9.0-py3.12-cuda12.8.1" ,
"gpuTypeId" : "NVIDIA_H100_80GB_SXM" ,
"gpuCount" : 1 ,
"regionId" : "eu-nl-1" ,
"vcpuCount" : 20 ,
"memoryInGb" : 125 ,
"containerDiskInGb" : 50 ,
"volumeInGb" : 100 ,
"volumeMountPath" : "/workspace" ,
"networkVolumeId" : null ,
"templateId" : null ,
"startCommand" : null ,
"ports" : [],
"env" : {
"HF_HOME" : "/workspace/hf" ,
"HF_TOKEN" : "{{ secrets.HF_TOKEN }}"
},
"costPerHr" : 0 ,
"lastExitCode" : null ,
"createdAt" : "2026-11-18T09:14:02Z" ,
"startedAt" : "2026-11-18T09:14:41Z" ,
"updatedAt" : "2026-11-18T17:40:03Z"
}Status When 404resource_not_found. Terminating an already TERMINATED pod returns 200 with the pod.
GET /pods/{podId}/logs
Returns the container's stdout and stderr, plus system events (image pull, start, exit). Logs are kept for 7 days after the pod terminates. With follow=true the response is a text/event-stream with one log event per line.
Parameters Name In Type Description podIdrequired path string The pod ID. tailquery integer Return only the last N lines (max 5,000). Default 500. sincequery string ISO 8601 timestamp; only lines after it. followquery boolean Stream new lines as server-sent events.
Request curl https://api.apipods.com/v1/pods/pod_8f2k1x9q/logs?tail=100 \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"object" : "list" ,
"data" : [
{
"object" : "log_line" ,
"timestamp" : "2026-11-18T09:14:39Z" ,
"stream" : "system" ,
"message" : "Image pulled (cached) in 2.1s"
},
{
"object" : "log_line" ,
"timestamp" : "2026-11-18T09:14:41Z" ,
"stream" : "stdout" ,
"message" : "[I 09:14:41 ServerApp] Jupyter Server 2.14.2 is running at: http://0.0.0.0:8888/"
},
{
"object" : "log_line" ,
"timestamp" : "2026-11-18T09:20:03Z" ,
"stream" : "stderr" ,
"message" : "wandb: Tracking run with wandb version 0.19.1"
}
],
"hasMore" : false ,
"nextCursor" : null
}follow=true (text/event-stream) Copy
event: log
data: {"timestamp":"2026-11-18T09:21:10Z","stream":"stdout","message":"step 120/2000 loss=1.842"}
event: log
data: {"timestamp":"2026-11-18T09:21:12Z","stream":"stdout","message":"step 121/2000 loss=1.839"}Status Meaning Billed CREATEDThe pod object exists and is waiting for a host with a free GPU of the requested type. Nothing PROVISIONINGA host is assigned. The image is being pulled, disks are allocated and the container is starting. Nothing RUNNINGThe container is running and its ports are reachable. GPU, container disk and volume disk EXITEDThe container stopped, either because you stopped it or because its main process exited. The GPU is released; the volume disk is kept. Volume disk at the stopped rate TERMINATEDThe pod and its container disk and volume disk are deleted. Network volumes are not affected. Terminal state. Nothing
See Pod lifecycle & states for transitions. The control plane is at https://api.apipods.com/v1.