Docs / Serverless

Endpoint settings

Endpoint settings control how many workers run, on which GPUs, for how long, and with what configuration. All of them can be changed after creation with PATCH /endpoints/{endpointId}.

Settings reference

FieldDefaultDescription
gpuPoolIdsrequiredOrdered list of pool IDs. The first pool with capacity wins.
gpuCount1GPUs per worker, 1 to 8. Use more than one only for models that need tensor parallelism.
regionIdsall regionsRegions workers may run in. Forced to the volume's region when a network volume is attached.
minWorkers0Always-on Active workers. Enterprise plan only.
maxWorkers3Upper bound on concurrent workers. Each running worker uses gpuCount GPUs of your plan's concurrent-GPU limit (10 on Starter, 50 on Team).
idleTimeoutInSec5Seconds a worker stays up with no job before shutting down. 1 to 3600.
executionTimeoutInSec600Maximum run time per job before it ends as TIMED_OUT. Up to 86400.
scalerTypeQUEUE_DELAYQUEUE_DELAY or REQUEST_COUNT.
scalerValue4Seconds of queue delay, or target jobs per worker.
warmstarttrueRestore new workers from a snapshot of an initialized worker.
containerDiskInGb20Ephemeral disk per worker. Wiped when the worker stops.
networkVolumeIdnullNetwork volume mounted at /volume in every worker.
env{}Environment variables. Values may reference secrets.

Min and max workers

maxWorkers caps both cost and throughput: with 5 workers and a 2-second job, the endpoint completes at most about 150 jobs per minute before jobs start queueing. Set it to your expected peak, plus a margin.

minWorkers keeps that many Active workers running at all times, removing cold starts for baseline traffic. It is priced separately; contact sales@apipods.com.

Idle and execution timeouts

Idle timeout trades cost against cold starts. With the default of 5 seconds a worker that just finished a job stays available for a quick follow-up and then stops. For chatty traffic with gaps of 10 to 60 seconds, a longer idle timeout is usually cheaper than repeated cold starts.

Execution timeout protects you from stuck jobs. When it expires, the job is marked TIMED_OUT and the worker is restarted. Override it per job with policy.executionTimeoutInSec on /run.

GPU priority

gpuPoolIds is a priority list, not a set. With ["L40S", "L4"] workers start on L40S whenever possible and fall back to L4 only when it is full. Each worker is billed at the rate of the pool it actually runs on.

Pool IDGPUVRAMPer secondPer hour
B300B300288 GB$0.00666$23.98
B200B200180 GB$0.00599$21.58
H200H200 SXM141 GB$0.00388$13.98
H100_SXMH100 SXM80 GB$0.00327$11.78
RTX_PRO_6000RTX PRO 600096 GB$0.00205$7.38
A100_80GBA100 80GB80 GB$0.00166$5.98
L40SL40S48 GB$0.00105$3.78
L4L424 GB$0.00042$1.50

Warmstart

When warmstart is true (the default), Apipods snapshots the memory and disk of the first worker that finishes initializing and caches the snapshot on hosts in the endpoint's regions. Later workers restore from it, typically in under 2 seconds, with models already in GPU memory.

  • The snapshot is invalidated when you change image, env or gpuPoolIds. The next worker is a full cold start and produces a new snapshot.
  • Snapshots are per pool: the first worker on a fallback pool also does a full cold start.
  • Code that must run fresh in each worker, such as opening network connections, belongs in the handler or should reconnect on failure.

Warmstart has no extra charge. Disable it only if your initialization depends on per-worker randomness or hardware state.

Network volume

Attach a network volume with networkVolumeId to share model weights and outputs between workers. It is mounted read-write at /volume. Because volumes live in one region, attaching one pins regionIds to that region, so pick a region with good availability for your pools.

Updating an endpoint

curl -X PATCH https://api.apipods.com/v1/endpoints/ep_4n8wq2zt \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "ghcr.io/acme/sdxl-worker:1.5.0",
    "maxWorkers": 10
  }'

Scaling and timeout changes apply immediately. Changes to image, env, gpuPoolIds, gpuCount or networkVolumeId trigger a rolling update: idle workers are replaced right away, busy workers finish their current job first. Queued jobs are kept and run on the new version.