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_WRITEscope, exported asAPIPODS_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
| Name | Type | Description |
|---|---|---|
gpuTypeIdrequired | string | GPU type, e.g. NVIDIA_H100_80GB_SXM. List them with GET /gpu-types. The CLI also accepts the short alias, e.g. H100_SXM. |
imagerequired | string | Docker image reference, e.g. apipods/pytorch:2.9.0-py3.12-cuda12.8.1. Ignored when templateId is set. |
name | string | Display name, 1 to 64 characters. Defaults to a generated name. |
gpuCount | integer | Number of GPUs, 1 to 8 depending on the GPU type. Default 1. |
regionId | string | Region such as eu-nl-1. Omit to place the pod in any region with capacity. |
containerDiskInGb | integer | Ephemeral disk for the container filesystem. Default 20, max 500. |
volumeInGb | integer | Persistent volume disk. Default 0 (no volume). |
volumeMountPath | string | Where the volume disk or network volume is mounted. Default /workspace. |
networkVolumeId | string | Attach a network volume (vol_…) instead of a volume disk. Forces regionId to the volume's region. |
templateId | string | Start from a template (tpl_…). Fields you pass override the template. |
ports | array | Up to 10 { port, protocol } objects. protocol is http or tcp. |
env | object | Environment variables. Values may reference secrets as {{ secrets.NAME }}. |
startCommand | string | null | Overrides 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).
{
"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
doneCommon errors
| Status | Code | Meaning |
|---|---|---|
400 | unsupported_gpu_type | The gpuTypeId or gpuPoolIds value does not exist. Use a full ID from GET /gpu-types or a pool ID from GET /gpu-pools. |
402 | insufficient_balance | Your balance does not cover one hour of the requested resources. |
403 | gpu_quota_exceeded | The request would exceed your plan's concurrent-GPU limit (GPUs in running pods plus running serverless workers). message names the plan and limit. |
503 | no_capacity | No GPU of the requested type is free in the requested region right now. |
402 | spend_limit_reached | The request would exceed the organization's monthly spend limit. |