Docs / API reference

Jobs (runtime)

The runtime API lives on its own host, run.apipods.com, and is addressed per endpoint. It is what your application calls in production.

Base URL
https://run.apipods.com/v1/{endpointId}

The job object

Job objects are lightweight and do not carry an object field on the runtime host. Results are kept for 30 minutes after completion for /run jobs and 60 seconds for /runsync jobs. Fields that do not apply to the current status are omitted for brevity on /run and /cancel responses.

NameTypeDescription
idstringUnique ID, prefixed job_.
statusenumIN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT.
delayTimeintegerMilliseconds the job waited in the queue before a worker picked it up.
executionTimeintegerMilliseconds the handler ran.
workerIdstring | nullWorker that ran the job.
outputanyWhatever your handler returned. Present when COMPLETED.
errorobject | null{ type, message, traceback } when FAILED; a timeout message when TIMED_OUT.
progressanyLatest value your handler sent with progress(). Only while IN_PROGRESS.
createdAtstringWhen the job was accepted.
completedAtstring | nullWhen the job reached a terminal state.
job object
{
  "id": "job_3x9wq2mt",
  "status": "COMPLETED",
  "delayTime": 812,
  "executionTime": 1934,
  "workerId": "wrk_8q3m2x9k",
  "output": {
    "imageUrl": "https://s3.eu-nl-1.apipods.com/vol_c7d2h4ke/outputs/job_3x9wq2mt.png",
    "seed": 1730299
  },
  "createdAt": "2026-11-18T10:02:13Z",
  "completedAt": "2026-11-18T10:02:16Z"
}

Job states

StatusTerminalMeaning
IN_QUEUENoAccepted and waiting for a free worker.
IN_PROGRESSNoA worker picked up the job and the handler is running.
COMPLETEDYesThe handler returned. The result is in output.
FAILEDYesThe handler raised an exception or returned an error key. Details are in error.
CANCELLEDYesCancelled through /cancel/{jobId} or /purge-queue before it completed.
TIMED_OUTYesThe job exceeded its execution timeout, or its time-to-live expired while it was still in the queue.

Endpoints

/status, /stream and /health accept READ keys; everything else needs READ_WRITE. Rate limits are per endpoint, see Rate limits.

MethodPathDescription
POST/{endpointId}/runQueue a job and return immediately
POST/{endpointId}/runsyncQueue a job and wait up to 90 s for the result
GET/{endpointId}/status/{jobId}Job status and output
GET/{endpointId}/stream/{jobId}Incremental output of a streaming handler
POST/{endpointId}/cancel/{jobId}Cancel a queued or running job
POST/{endpointId}/retry/{jobId}Re-queue a failed, timed-out or cancelled job
POST/{endpointId}/purge-queueCancel every queued job
GET/{endpointId}/healthQueue depth and worker counts

Run a job (async)

POSTrun.apipods.com/v1/{endpointId}/run

Adds a job to the endpoint's queue and returns its ID. Scales up a worker if needed. Fetch the result with /status or receive it on your webhook.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
inputrequiredbodyany JSONPassed to your handler as job["input"]. Max 10 MB.
webhookbodystringHTTPS URL that receives the job object when it reaches a terminal state.
policy.executionTimeoutInSecbodyintegerOverrides the endpoint's execution timeout for this job.
policy.ttlInSecbodyintegerHow long the job may live, queue time included. Default 86400.
policy.lowPrioritybodybooleanLow-priority jobs never trigger scale-up; they run when a worker is free.
Idempotency-KeyheaderstringRepeating a key returns the original job ID.

Request

curl -X POST https://run.apipods.com/v1/ep_4n8wq2zt/run \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "a lighthouse on a cliff at dusk, 35mm photo",
      "steps": 4
    },
    "webhook": "https://api.example.com/hooks/apipods",
    "policy": {
      "executionTimeoutInSec": 120,
      "ttlInSec": 3600,
      "lowPriority": false
    }
  }'

Response

202 Accepted
{
  "id": "job_3x9wq2mt",
  "status": "IN_QUEUE"
}
StatusWhen
400missing_parameter: input is missing.
402insufficient_balance or spend_limit_reached.
404resource_not_found: unknown endpoint.
413payload_too_large: input over 10 MB. Upload large files to a network volume and pass a path.
429rate_limited.

Run a job (sync)

POSTrun.apipods.com/v1/{endpointId}/runsync

Same as /run, but holds the connection open for up to 90 seconds and returns the finished job. If the job is not done in time, the response has status IN_QUEUE or IN_PROGRESS and you continue with /status. Input limit 20 MB.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
inputrequiredbodyany JSONHandler input.
policybodyobjectSame as /run.

Request

curl -X POST https://run.apipods.com/v1/ep_4n8wq2zt/runsync \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "a lighthouse on a cliff at dusk, 35mm photo",
      "steps": 4
    }
  }'

Response

200 OK
{
  "id": "job_3x9wq2mt",
  "status": "COMPLETED",
  "delayTime": 812,
  "executionTime": 1934,
  "workerId": "wrk_8q3m2x9k",
  "output": {
    "imageUrl": "https://s3.eu-nl-1.apipods.com/vol_c7d2h4ke/outputs/job_3x9wq2mt.png",
    "seed": 1730299
  },
  "createdAt": "2026-11-18T10:02:13Z",
  "completedAt": "2026-11-18T10:02:16Z"
}

Get job status

GETrun.apipods.com/v1/{endpointId}/status/{jobId}

Returns the job. Poll with backoff until the status is terminal. A failed job still returns 200.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
jobIdrequiredpathstringThe job ID.

Request

curl https://run.apipods.com/v1/ep_4n8wq2zt/status/job_3x9wq2mt \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "id": "job_3x9wq2mt",
  "status": "COMPLETED",
  "delayTime": 812,
  "executionTime": 1934,
  "workerId": "wrk_8q3m2x9k",
  "output": {
    "imageUrl": "https://s3.eu-nl-1.apipods.com/vol_c7d2h4ke/outputs/job_3x9wq2mt.png",
    "seed": 1730299
  },
  "createdAt": "2026-11-18T10:02:13Z",
  "completedAt": "2026-11-18T10:02:16Z"
}
StatusWhen
404resource_not_found: unknown job, or its result has expired.
200 OK (failed job)
{
  "id": "job_7k2m4p8d",
  "status": "FAILED",
  "delayTime": 640,
  "executionTime": 211,
  "workerId": "wrk_8q3m2x9k",
  "error": {
    "type": "ValueError",
    "message": "steps must be between 1 and 50",
    "traceback": "Traceback (most recent call last): ..."
  },
  "createdAt": "2026-11-18T10:05:40Z",
  "completedAt": "2026-11-18T10:05:41Z"
}

Stream job output

GETrun.apipods.com/v1/{endpointId}/stream/{jobId}

For generator handlers. Each call returns the chunks produced since your previous call. With Accept: text/event-stream the connection stays open and chunks arrive as server-sent events until the job ends.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
jobIdrequiredpathstringThe job ID.
Acceptheaderstringapplication/json (default, polling) or text/event-stream.

Request

curl -N https://run.apipods.com/v1/ep_llama70b/stream/job_7k2m4p8d \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Accept: text/event-stream"

Response

200 OK
{
  "status": "IN_PROGRESS",
  "stream": [
    {
      "output": "Silicon rivers"
    },
    {
      "output": " hum"
    }
  ]
}
text/event-stream
event: chunk
data: {"output":"Silicon rivers"}

event: chunk
data: {"output":" hum"}

event: done
data: {"id":"job_7k2m4p8d","status":"COMPLETED","delayTime":402,"executionTime":1288}

Cancel a job

POSTrun.apipods.com/v1/{endpointId}/cancel/{jobId}

Removes a queued job, or stops a running one (the worker process receives SIGTERM, then is replaced). Cancelling a job that is already terminal returns it unchanged.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
jobIdrequiredpathstringThe job ID.

Request

curl -X POST https://run.apipods.com/v1/ep_4n8wq2zt/cancel/job_3x9wq2mt \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "id": "job_3x9wq2mt",
  "status": "CANCELLED"
}

Retry a job

POSTrun.apipods.com/v1/{endpointId}/retry/{jobId}

Re-queues a FAILED, TIMED_OUT or CANCELLED job with the same input and the same job ID. The previous output and error are cleared. Only possible while the job result is still retained.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.
jobIdrequiredpathstringThe job ID.

Request

curl -X POST https://run.apipods.com/v1/ep_4n8wq2zt/retry/job_7k2m4p8d \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

202 Accepted
{
  "id": "job_7k2m4p8d",
  "status": "IN_QUEUE"
}
StatusWhen
409invalid_state: the job is IN_QUEUE, IN_PROGRESS or COMPLETED.

Purge the queue

POSTrun.apipods.com/v1/{endpointId}/purge-queue

Cancels every job that is still IN_QUEUE. Jobs already IN_PROGRESS keep running.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.

Request

curl -X POST https://run.apipods.com/v1/ep_4n8wq2zt/purge-queue \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "removed": 12
}

Endpoint health

GETrun.apipods.com/v1/{endpointId}/health

Live queue and worker counts. completed, failed and retried count jobs since the endpoint was created.

Parameters

NameInTypeDescription
endpointIdrequiredpathstringThe endpoint ID.

Request

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

Response

200 OK
{
  "jobs": {
    "inQueue": 3,
    "inProgress": 4,
    "completed": 18342,
    "failed": 12,
    "retried": 5
  },
  "workers": {
    "initializing": 1,
    "idle": 0,
    "running": 4,
    "throttled": 0,
    "unhealthy": 0
  }
}

OpenAI-compatible routes

Endpoints running the vLLM worker also expose an OpenAI-compatible API. Point any OpenAI client at https://run.apipods.com/v1/{endpointId}/openai/v1 and use your Apipods API key as the key.

MethodPathDescription
POST/{endpointId}/openai/v1/chat/completionsChat completions, with stream: true support.
POST/{endpointId}/openai/v1/completionsText completions.
GET/{endpointId}/openai/v1/modelsThe served model name.
curl -X POST https://run.apipods.com/v1/ep_llama70b/openai/v1/chat/completions \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.3-70B-Instruct",
    "messages": [
      {
        "role": "user",
        "content": "Explain KV cache in one sentence."
      }
    ],
    "max_tokens": 128
  }'
Note: Requests on these routes are queued as regular jobs, so they appear in /health, metrics and logs, and are billed the same way.