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.

The pod object

NameTypeDescription
idstringUnique ID, prefixed pod_.
objectstringAlways pod.
namestringDisplay name, 1 to 64 characters.
statusenumObserved state: CREATED, PROVISIONING, RUNNING, EXITED, TERMINATED.
desiredStatusenumTarget state the platform is driving towards: RUNNING, EXITED or TERMINATED.
imagestringDocker image reference, e.g. apipods/pytorch:2.9.0-py3.12-cuda12.8.1.
gpuTypeIdstringFull GPU type ID, e.g. NVIDIA_H100_80GB_SXM. See GPU types.
gpuCountintegerNumber of GPUs attached to the pod.
regionIdstringRegion the pod runs in, e.g. eu-nl-1.
vcpuCountintegervCPUs allocated (scales with gpuCount).
memoryInGbintegerSystem RAM allocated (scales with gpuCount).
containerDiskInGbintegerSize of the ephemeral container disk. Wiped on stop.
volumeInGbintegerSize of the persistent volume disk. 0 means no volume disk.
volumeMountPathstringWhere the volume disk or network volume is mounted. Default /workspace.
networkVolumeIdstring | nullAttached network volume (vol_…). Replaces the volume disk at volumeMountPath.
templateIdstring | nullTemplate the pod was created from, if any.
startCommandstring | nullOverrides the image's CMD. null uses the image default.
portsarrayExposed ports. HTTP ports have a url; TCP ports have publicIp and publicPort while running.
envobjectEnvironment variables. Values may reference secrets as {{ secrets.NAME }}; references are returned unresolved.
costPerHrnumberCurrent hourly cost in USD for GPU and disks while running.
lastExitCodeinteger | nullExit code of the container's main process the last time it stopped.
createdAtstringISO 8601 timestamp.
startedAtstring | nullWhen the pod last entered RUNNING.
updatedAtstringISO 8601 timestamp of the last change.
pod object
{
  "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"
}

Endpoints

MethodPathDescription
GET/podsList pods
POST/podsCreate a pod
GET/pods/{podId}Retrieve a pod
PATCH/pods/{podId}Update a pod
POST/pods/{podId}/startStart an EXITED pod
POST/pods/{podId}/stopStop a running pod
POST/pods/{podId}/restartRestart the container in place
DELETE/pods/{podId}Terminate a pod
GET/pods/{podId}/logsRead or stream container logs

List pods

GET/pods

Returns pods in your organization, newest first. Terminated pods are listed for 30 days.

Parameters

NameInTypeDescription
statusqueryenumFilter by status.
gpuTypeIdquerystringFilter by GPU type.
regionIdquerystringFilter by region.
limitqueryinteger1 to 100, default 20. See Pagination.
cursorquerystringCursor 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
{
  "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
}

Create a pod

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

NameInTypeDescription
namerequiredbodystringDisplay name, 1 to 64 characters.
gpuTypeIdrequiredbodystringFull GPU type ID, e.g. NVIDIA_H100_80GB_SXM. Short aliases such as H100_SXM are accepted by the SDKs and CLI only.
imagebodystringDocker image. Required unless templateId is set.
templateIdbodystringCreate from a template. Fields you also pass override the template's values.
gpuCountbodyintegerDefault 1. Maximum depends on the GPU type (maxGpuCount).
regionIdbodystringRegion 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.
containerDiskInGbbodyintegerDefault 20, maximum 500.
volumeInGbbodyintegerDefault 0 (no volume disk). Maximum 4000.
volumeMountPathbodystringDefault /workspace.
networkVolumeIdbodystringMount a network volume at volumeMountPath instead of a volume disk.
portsbodyarrayUp to 10 objects { "port": 8888, "protocol": "http" }. protocol is http or tcp.
envbodyobjectUp to 100 variables. Reference secrets as {{ secrets.NAME }}.
startCommandbodystringOverride the image's CMD.
registryCredentialIdbodystringCredentials for pulling a private image (rcr_…).
Idempotency-KeyheaderstringRecommended. 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
{
  "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"
}
StatusWhen
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.

Retrieve a pod

GET/pods/{podId}

Returns a single pod, including its current status, ports and cost.

Parameters

NameInTypeDescription
podIdrequiredpathstringThe pod ID.

Request

curl https://api.apipods.com/v1/pods/pod_8f2k1x9q \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "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"
}
StatusWhen
404resource_not_found.

Update a pod

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.
namebodystringNew display name. Applied immediately.
imagebodystringNew image. Restarts a running pod.
envbodyobjectReplaces all environment variables. Restarts a running pod.
portsbodyarrayReplaces exposed ports. Restarts a running pod.
startCommandbodystring | nullNew start command, or null for the image default. Restarts a running pod.
volumeInGbbodyintegerNew volume disk size. Can only grow; applied online.
containerDiskInGbbodyintegerCan 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
{
  "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"
}
StatusWhen
400invalid_parameter, e.g. shrinking volumeInGb.
409invalid_state: the pod is TERMINATED, or containerDiskInGb was changed while not EXITED.

Start a pod

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.

Request

curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/start \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "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"
}
StatusWhen
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.

Stop a pod

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.

Request

curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/stop \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "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"
}
StatusWhen
409invalid_state: the pod is not RUNNING or PROVISIONING.

Restart a pod

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.

Request

curl -X POST https://api.apipods.com/v1/pods/pod_8f2k1x9q/restart \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "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"
}
StatusWhen
409invalid_state: the pod is not RUNNING.

Terminate a pod

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.

Request

curl -X DELETE https://api.apipods.com/v1/pods/pod_8f2k1x9q \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "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"
}
StatusWhen
404resource_not_found. Terminating an already TERMINATED pod returns 200 with the pod.

Read pod logs

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

NameInTypeDescription
podIdrequiredpathstringThe pod ID.
tailqueryintegerReturn only the last N lines (max 5,000). Default 500.
sincequerystringISO 8601 timestamp; only lines after it.
followquerybooleanStream 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
{
  "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)
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 values

StatusMeaningBilled
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.