Docs / Pods

Create a pod

Create a pod by choosing a GPU type, an image and how much storage you need. Everything else has a sensible default.

Before you start

  • An API key with READ_WRITE scope, exported as APIPODS_API_KEY. See Authentication.
  • A balance that covers at least one hour of the pod. Otherwise the request fails with 402 insufficient_balance.
  • Optional: an SSH key on your account so you can connect over SSH.

Create the pod

The example below starts one H100 SXM in eu-nl-1 with the Apipods PyTorch image, a 100 GB volume disk at /workspace, JupyterLab on port 8888 and SSH on port 22.

curl -X POST https://api.apipods.com/v1/pods \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -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 }}"
    }
  }'

The API returns the pod with status CREATED. It moves to PROVISIONING as soon as a host is assigned and to RUNNING once the image is pulled and the container starts, usually within 30 to 90 seconds for cached images.

Options

NameTypeDescription
gpuTypeIdrequiredstringGPU type, e.g. NVIDIA_H100_80GB_SXM. List them with GET /gpu-types. The CLI also accepts the short alias, e.g. H100_SXM.
imagerequiredstringDocker image reference, e.g. apipods/pytorch:2.9.0-py3.12-cuda12.8.1. Ignored when templateId is set.
namestringDisplay name, 1 to 64 characters. Defaults to a generated name.
gpuCountintegerNumber of GPUs, 1 to 8 depending on the GPU type. Default 1.
regionIdstringRegion such as eu-nl-1. Omit to place the pod in any region with capacity.
containerDiskInGbintegerEphemeral disk for the container filesystem. Default 20, max 500.
volumeInGbintegerPersistent volume disk. Default 0 (no volume).
volumeMountPathstringWhere the volume disk or network volume is mounted. Default /workspace.
networkVolumeIdstringAttach a network volume (vol_…) instead of a volume disk. Forces regionId to the volume's region.
templateIdstringStart from a template (tpl_…). Fields you pass override the template.
portsarrayUp to 10 { port, protocol } objects. protocol is http or tcp.
envobjectEnvironment variables. Values may reference secrets as {{ secrets.NAME }}.
startCommandstring | nullOverrides the image's CMD. Default null (use the image's command).

The pod object

Once running, a pod looks like this. Ports gain a public url (HTTP) or publicIp and publicPort (TCP).

pod.json
{
  "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"
}

costPerHr is the total hourly price of the GPUs. Storage is billed separately; see Billing model.

Wait until the pod is running

Poll GET /pods/{podId}, use the SDK helper, or subscribe to the pod.running webhook event.

until [ "$(curl -s https://api.apipods.com/v1/pods/pod_8f2k1x9q \
    -H "Authorization: Bearer $APIPODS_API_KEY" | jq -r .status)" = "RUNNING" ]; do
  sleep 5
done

Common errors

StatusCodeMeaning
400unsupported_gpu_typeThe gpuTypeId or gpuPoolIds value does not exist. Use a full ID from GET /gpu-types or a pool ID from GET /gpu-pools.
402insufficient_balanceYour balance does not cover one hour of the requested resources.
403gpu_quota_exceededThe request would exceed your plan's concurrent-GPU limit (GPUs in running pods plus running serverless workers). message names the plan and limit.
503no_capacityNo GPU of the requested type is free in the requested region right now.
402spend_limit_reachedThe request would exceed the organization's monthly spend limit.