Docs / API reference

Endpoints

An endpoint is a queue plus an autoscaling pool of workers running your image. These control-plane endpoints configure it; to send jobs use the runtime API.

The endpoint object

Pricing is per second per GPU pool, and running workers count toward your plan's concurrent-GPU limit; see Pricing.

NameTypeDescription
idstringUnique ID, prefixed ep_.
objectstringAlways endpoint.
namestringDisplay name, 1 to 64 characters.
imagestring | nullWorker image. Either image or templateId is set.
templateIdstring | nullServerless template (type: SERVERLESS) the worker is built from.
registryCredentialIdstring | nullCredentials for a private registry.
gpuPoolIdsstring[]GPU pools in priority order, e.g. ["L40S", "L4"]. See GPU types.
gpuCountintegerGPUs per worker, 1 to 8.
regionIdsstring[]Regions workers may run in. Empty means all regions. With a network volume, only the volume's region.
minWorkersintegerAlways-on Active workers. Default 0; above 0 requires the Enterprise plan (Active workers).
maxWorkersintegerUpper bound on concurrent workers. Default 3.
idleTimeoutInSecintegerSeconds an idle Flex worker stays up before scaling down. Default 5, max 3600.
executionTimeoutInSecintegerMaximum run time of one job. Default 600, max 86400.
scalerTypeenumQUEUE_DELAY (scale up when jobs wait longer than scalerValue seconds) or REQUEST_COUNT (target scalerValue jobs per worker).
scalerValueintegerThreshold for the scaler. Default 4.
warmstartbooleanRestore workers from a cached snapshot for fast cold starts. Default true.
containerDiskInGbintegerContainer disk per worker. Default 20.
networkVolumeIdstring | nullNetwork volume mounted at /volume in every worker.
envobjectEnvironment variables. Reference secrets as {{ secrets.NAME }}.
runUrlstringBase URL for the runtime API of this endpoint.
createdAtstringISO 8601 timestamp.
updatedAtstringISO 8601 timestamp.
endpoint object
{
  "id": "ep_4n8wq2zt",
  "object": "endpoint",
  "name": "sdxl-turbo",
  "image": "ghcr.io/acme/sdxl-worker:1.4.0",
  "templateId": null,
  "registryCredentialId": "rcr_6w2m9q4k",
  "gpuPoolIds": [
    "L40S",
    "L4"
  ],
  "gpuCount": 1,
  "regionIds": [
    "eu-nl-1"
  ],
  "minWorkers": 0,
  "maxWorkers": 5,
  "idleTimeoutInSec": 5,
  "executionTimeoutInSec": 600,
  "scalerType": "QUEUE_DELAY",
  "scalerValue": 4,
  "warmstart": true,
  "containerDiskInGb": 20,
  "networkVolumeId": "vol_c7d2h4ke",
  "env": {
    "MODEL_ID": "stabilityai/sdxl-turbo"
  },
  "runUrl": "https://run.apipods.com/v1/ep_4n8wq2zt",
  "createdAt": "2026-11-12T16:40:11Z",
  "updatedAt": "2026-11-18T08:02:55Z"
}

Endpoints

MethodPathDescription
GET/endpointsList endpoints
POST/endpointsCreate an endpoint
GET/endpoints/{endpointId}Retrieve an endpoint
PATCH/endpoints/{endpointId}Update settings or roll out a new image
DELETE/endpoints/{endpointId}Delete an endpoint
GET/endpoints/{endpointId}/workersList workers
GET/endpoints/{endpointId}/metricsRequest, latency and worker metrics
GET/endpoints/{endpointId}/logsWorker logs

List endpoints

GET/endpoints

Returns endpoints in your organization, newest first. Supports pagination.

Parameters

NameInTypeDescription
limitqueryinteger1 to 100, default 20.
cursorquerystringCursor from a previous page.

Request

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

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "id": "ep_4n8wq2zt",
      "object": "endpoint",
      "name": "sdxl-turbo",
      "image": "ghcr.io/acme/sdxl-worker:1.4.0",
      "templateId": null,
      "registryCredentialId": "rcr_6w2m9q4k",
      "gpuPoolIds": [
        "L40S",
        "L4"
      ],
      "gpuCount": 1,
      "regionIds": [
        "eu-nl-1"
      ],
      "minWorkers": 0,
      "maxWorkers": 5,
      "idleTimeoutInSec": 5,
      "executionTimeoutInSec": 600,
      "scalerType": "QUEUE_DELAY",
      "scalerValue": 4,
      "warmstart": true,
      "containerDiskInGb": 20,
      "networkVolumeId": "vol_c7d2h4ke",
      "env": {
        "MODEL_ID": "stabilityai/sdxl-turbo"
      },
      "runUrl": "https://run.apipods.com/v1/ep_4n8wq2zt",
      "createdAt": "2026-11-12T16:40:11Z",
      "updatedAt": "2026-11-18T08:02:55Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Create an endpoint

POST/endpoints

Creates an endpoint. No workers start until the first job arrives (unless minWorkers is above 0). The response includes webhookSecret, used to sign job webhooks. It is returned only once.

Parameters

NameInTypeDescription
namerequiredbodystringDisplay name.
imagebodystringWorker image. Required unless templateId is set.
templateIdbodystringA SERVERLESS template.
gpuPoolIdsrequiredbodystring[]One or more GPU pools in priority order.
gpuCountbodyintegerDefault 1.
regionIdsbodystring[]Restrict regions. Default: all regions.
minWorkersbodyintegerDefault 0.
maxWorkersbodyintegerDefault 3. Counts towards your worker quota.
idleTimeoutInSecbodyintegerDefault 5.
executionTimeoutInSecbodyintegerDefault 600.
scalerTypebodyenumDefault QUEUE_DELAY.
scalerValuebodyintegerDefault 4.
warmstartbodybooleanDefault true.
containerDiskInGbbodyintegerDefault 20.
networkVolumeIdbodystringMount a network volume. Pins regionIds to the volume's region.
envbodyobjectEnvironment variables.
registryCredentialIdbodystringCredentials for a private image.

Request

curl -X POST https://api.apipods.com/v1/endpoints \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sdxl-turbo",
    "image": "ghcr.io/acme/sdxl-worker:1.4.0",
    "registryCredentialId": "rcr_6w2m9q4k",
    "gpuPoolIds": [
      "L40S",
      "L4"
    ],
    "gpuCount": 1,
    "maxWorkers": 5,
    "idleTimeoutInSec": 5,
    "executionTimeoutInSec": 600,
    "networkVolumeId": "vol_c7d2h4ke",
    "env": {
      "MODEL_ID": "stabilityai/sdxl-turbo"
    }
  }'

Response

201 Created
{
  "id": "ep_4n8wq2zt",
  "object": "endpoint",
  "name": "sdxl-turbo",
  "image": "ghcr.io/acme/sdxl-worker:1.4.0",
  "templateId": null,
  "registryCredentialId": "rcr_6w2m9q4k",
  "gpuPoolIds": [
    "L40S",
    "L4"
  ],
  "gpuCount": 1,
  "regionIds": [
    "eu-nl-1"
  ],
  "minWorkers": 0,
  "maxWorkers": 5,
  "idleTimeoutInSec": 5,
  "executionTimeoutInSec": 600,
  "scalerType": "QUEUE_DELAY",
  "scalerValue": 4,
  "warmstart": true,
  "containerDiskInGb": 20,
  "networkVolumeId": "vol_c7d2h4ke",
  "env": {
    "MODEL_ID": "stabilityai/sdxl-turbo"
  },
  "runUrl": "https://run.apipods.com/v1/ep_4n8wq2zt",
  "createdAt": "2026-11-12T16:40:11Z",
  "updatedAt": "2026-11-12T16:40:11Z",
  "webhookSecret": "whsec_7Hq2…"
}
StatusWhen
400invalid_parameter or unsupported_gpu_type (unknown pool ID).
403gpu_quota_exceeded (sum of maxWorkers over your quota) or active_workers_not_enabled.

Retrieve an endpoint

GET/endpoints/{endpointId}

Returns one endpoint. webhookSecret is never included here.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.

Request

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

Response

200 OK
{
  "id": "ep_4n8wq2zt",
  "object": "endpoint",
  "name": "sdxl-turbo",
  "image": "ghcr.io/acme/sdxl-worker:1.4.0",
  "templateId": null,
  "registryCredentialId": "rcr_6w2m9q4k",
  "gpuPoolIds": [
    "L40S",
    "L4"
  ],
  "gpuCount": 1,
  "regionIds": [
    "eu-nl-1"
  ],
  "minWorkers": 0,
  "maxWorkers": 5,
  "idleTimeoutInSec": 5,
  "executionTimeoutInSec": 600,
  "scalerType": "QUEUE_DELAY",
  "scalerValue": 4,
  "warmstart": true,
  "containerDiskInGb": 20,
  "networkVolumeId": "vol_c7d2h4ke",
  "env": {
    "MODEL_ID": "stabilityai/sdxl-turbo"
  },
  "runUrl": "https://run.apipods.com/v1/ep_4n8wq2zt",
  "createdAt": "2026-11-12T16:40:11Z",
  "updatedAt": "2026-11-18T08:02:55Z"
}
StatusWhen
404resource_not_found.

Update an endpoint

PATCH/endpoints/{endpointId}

Changes settings. Scaling settings apply within seconds. Changing image, env, gpuPoolIds or gpuCount triggers a rolling update: idle workers are replaced right away, busy workers finish their current job first. Jobs in the queue are not lost. The Warmstart snapshot is rebuilt on the first new worker.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
…bodyAny writable field from the endpoint object.

Request

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
  }'

Response

200 OK
{
  "id": "ep_4n8wq2zt",
  "object": "endpoint",
  "name": "sdxl-turbo",
  "image": "ghcr.io/acme/sdxl-worker:1.5.0",
  "templateId": null,
  "registryCredentialId": "rcr_6w2m9q4k",
  "gpuPoolIds": [
    "L40S",
    "L4"
  ],
  "gpuCount": 1,
  "regionIds": [
    "eu-nl-1"
  ],
  "minWorkers": 0,
  "maxWorkers": 10,
  "idleTimeoutInSec": 5,
  "executionTimeoutInSec": 600,
  "scalerType": "QUEUE_DELAY",
  "scalerValue": 4,
  "warmstart": true,
  "containerDiskInGb": 20,
  "networkVolumeId": "vol_c7d2h4ke",
  "env": {
    "MODEL_ID": "stabilityai/sdxl-turbo"
  },
  "runUrl": "https://run.apipods.com/v1/ep_4n8wq2zt",
  "createdAt": "2026-11-12T16:40:11Z",
  "updatedAt": "2026-11-18T12:15:00Z"
}
StatusWhen
403active_workers_not_enabled when raising minWorkers above 0 on a plan without Active workers (Enterprise only).

Delete an endpoint

DELETE/endpoints/{endpointId}

Deletes the endpoint. Queued jobs are cancelled, running jobs are stopped and all workers are shut down. Attached network volumes are kept.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.

Request

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

Response

Returns 204 No Content with an empty body.

List workers

GET/endpoints/{endpointId}/workers

Returns the endpoint's current workers. Workers that have shut down are not listed.

Worker statusMeaning
INITIALIZINGThe worker is starting: pulling the image or restoring a Warmstart snapshot, then running your module-level code.
IDLEReady and waiting for a job. Billed until the idle timeout expires (Flex) or always (Active).
RUNNINGExecuting one or more jobs.
THROTTLEDScheduled but waiting for a GPU from your priority list to free up on the host.
UNHEALTHYThe worker crashed or failed its health check. It is replaced automatically.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
statusqueryenumFilter by worker status.

Request

curl https://api.apipods.com/v1/endpoints/ep_4n8wq2zt/workers \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "id": "wrk_8q3m2x9k",
      "object": "worker",
      "endpointId": "ep_4n8wq2zt",
      "status": "RUNNING",
      "gpuPoolId": "L40S",
      "regionId": "eu-nl-1",
      "warmstart": true,
      "startedAt": "2026-11-18T10:01:58Z"
    },
    {
      "id": "wrk_3t7n2k9w",
      "object": "worker",
      "endpointId": "ep_4n8wq2zt",
      "status": "IDLE",
      "gpuPoolId": "L40S",
      "regionId": "eu-nl-1",
      "warmstart": true,
      "startedAt": "2026-11-18T10:03:11Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Endpoint metrics

GET/endpoints/{endpointId}/metrics

Aggregated request, latency and worker metrics. Latencies are in milliseconds, matching the job delayTime and executionTime fields.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
windowqueryenum1h (1-minute buckets), 24h (15-minute buckets) or 7d (1-hour buckets). Default 1h.

Request

curl https://api.apipods.com/v1/endpoints/ep_4n8wq2zt/metrics?window=1h \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "endpoint_metrics",
  "endpointId": "ep_4n8wq2zt",
  "window": "1h",
  "totals": {
    "completed": 1284,
    "failed": 3,
    "cancelled": 0,
    "timedOut": 1,
    "delayTimeP50": 420,
    "delayTimeP95": 2380,
    "executionTimeP50": 1910,
    "executionTimeP95": 2840,
    "coldStarts": 7,
    "gpuSeconds": 2913
  },
  "buckets": [
    {
      "start": "2026-11-18T10:00:00Z",
      "completed": 22,
      "failed": 0,
      "inQueue": 0,
      "workersRunning": 2,
      "workersIdle": 1
    },
    {
      "start": "2026-11-18T10:01:00Z",
      "completed": 25,
      "failed": 1,
      "inQueue": 3,
      "workersRunning": 3,
      "workersIdle": 0
    }
  ]
}

Endpoint logs

GET/endpoints/{endpointId}/logs

Worker stdout/stderr and system events, newest last. Kept for 7 days. Supports follow=true for server-sent events, like pod logs.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
workerIdquerystringOnly lines from one worker.
jobIdquerystringOnly lines logged while this job was running.
sincequerystringISO 8601 timestamp.
tailqueryintegerLast N lines, max 5,000. Default 500.
followquerybooleanStream as server-sent events.

Request

curl https://api.apipods.com/v1/endpoints/ep_4n8wq2zt/logs?jobId=job_3x9wq2mt \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "object": "log_line",
      "timestamp": "2026-11-18T10:02:14Z",
      "workerId": "wrk_8q3m2x9k",
      "jobId": "job_3x9wq2mt",
      "stream": "stdout",
      "message": "loading pipeline from /volume/models/sdxl-turbo"
    },
    {
      "object": "log_line",
      "timestamp": "2026-11-18T10:02:16Z",
      "workerId": "wrk_8q3m2x9k",
      "jobId": "job_3x9wq2mt",
      "stream": "stdout",
      "message": "generated 1 image in 1.71s"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}