Skip to main content
POST
Create a serverless endpoint

Authorizations

Authorization
string
header
required

Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.

Body

application/json

Reusable container configuration shared across templates, pods, and serverless endpoints. Adding a field here automatically propagates to all three resources.

name
string
required
Minimum string length: 1
Example:

"my-inference"

type
enum<string>
required

Request-routing model. Required — it determines the valid scaler and request URLs, so it must be chosen explicitly on every create.

Available options:
QUEUE,
LOAD_BALANCER
gpu
object
required
scaling
object
required

Autoscaling signal — a discriminated union on type: QUEUE_DELAY (queue-based endpoints only) or REQUEST_COUNT. The scaler is chosen independently of the endpoint's routing type and can be switched on update.

image
string

Docker image reference

Example:

"runpod/pytorch:2.8.0-py3.11-cuda12.8.1"

args
string

Arguments passed to the container entrypoint

Example:

""

disk
integer

Container disk in GB (ephemeral, wiped on restart)

Required range: x >= 1
Example:

50

ports
string[]

Exposed ports, formatted as port/protocol

Example:
env
object

Environment variables as key-value pairs

Example:
registry
string | null

Container registry credential ID (for private images)

Example:

null

templateId
string

ID of a serverless template to base this endpoint on. The template is resolved at create time into the same container settings you could otherwise spread into this body (image, args, disk, ports, env, registry); explicit body fields override the template's, except env, which is merged per key with body values winning. The template's allowedCudaVersions seeds the endpoint's when the body omits it; its pod-specific startSsh/startJupyter flags are ignored. Later template edits do not affect the endpoint. The template may be one of your own or a public catalog template — see GET /v2/catalog/templates (unknown or inaccessible ID → 404) — and must be a serverless template (→ 422).

Minimum string length: 1
Example:

"30zmvf89kd"

workers
object
dataCenterIds
string[]

Preferred data centers for placement. Omit or pass an empty array to let the scheduler choose.

networkVolumes
string[]
timeout
integer
default:300000
flashboot
enum<string>
default:OFF

FlashBoot cold-start acceleration mode.

  • OFF — disabled
  • FLASHBOOT — enabled
  • PRIORITY_FLASHBOOT — enabled with priority capacity
Available options:
OFF,
FLASHBOOT,
PRIORITY_FLASHBOOT
allowedCudaVersions
string[]

Acceptable CUDA versions for worker placement, as major.minor. Omit to accept any version (or inherit the template's constraint when creating from templateId). Matching is exact — discover valid values per GPU type via GET /v2/catalog/gpus?include=AVAILABILITY (cudaVersions).

Pattern: ^\d+\.\d+$
Example:

Response

Created

Reusable container configuration shared across templates, pods, and serverless endpoints. Adding a field here automatically propagates to all three resources.

id
string
required
Example:

"ep_abc123"

name
string
required
Example:

"my-inference"

workers
object
required
scaling
object
required

Autoscaling signal — a discriminated union on type: QUEUE_DELAY (queue-based endpoints only) or REQUEST_COUNT. The scaler is chosen independently of the endpoint's routing type and can be switched on update.

dataCenterIds
string[]
required
Example:
networkVolumes
string[]
required
Example:
timeout
integer
required

Per-request execution timeout in milliseconds

Example:

300000

flashboot
enum<string>
required

FlashBoot cold-start acceleration mode.

  • OFF — disabled
  • FLASHBOOT — enabled
  • PRIORITY_FLASHBOOT — enabled with priority capacity
Available options:
OFF,
FLASHBOOT,
PRIORITY_FLASHBOOT
allowedCudaVersions
string[]
required

Acceptable CUDA versions for worker placement, as major.minor. Empty means any version.

Example:
createdAt
string<date-time>
required
Example:

"2026-03-13T20:00:00Z"

image
string

Docker image reference

Example:

"runpod/pytorch:2.8.0-py3.11-cuda12.8.1"

args
string

Arguments passed to the container entrypoint

Example:

""

disk
integer

Container disk in GB (ephemeral, wiped on restart)

Required range: x >= 1
Example:

50

ports
string[]

Exposed ports, formatted as port/protocol

Example:
env
object

Environment variables as key-value pairs

Example:
registry
string | null

Container registry credential ID (for private images)

Example:

null

type
enum<string>

Request-routing semantics for a modern serverless endpoint.

  • QUEUE — submit asynchronous or synchronous jobs through the managed queue.
  • LOAD_BALANCER — send requests directly to worker-defined HTTP paths. Configure via env: PORT (server port, default 80), PORT_HEALTH (health-check port, default 80), and HEALTH_CHECK_PATH (path the load balancer polls for worker health, default /ping).
Available options:
QUEUE,
LOAD_BALANCER
requestUrls
object

Request URLs appropriate to the endpoint's top-level type. Queue-based endpoints provide job submission and management URLs; load-balancing endpoints provide base and health because their remaining paths are worker-defined.

gpu
object | null
cpu
object | null

Read-only. Present for CPU serverless endpoints; CPU create/update is not yet supported.

Last modified on August 14, 2026