> ## Documentation Index
> Fetch the complete documentation index at: https://runpod-b18f5ded-lg-tax-changes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a serverless endpoint

> Creates a serverless endpoint. Callers specify exactly one of `gpu` or
`cpu`; neither or both returns 400. Container settings come from the
body, from a serverless template referenced by `templateId` (body
fields override the template's), or both; `image` is required unless
`templateId` is set. See `CreateEndpointRequest` for the full body.

The CUDA constraints live on `gpu` — `gpu.allowedCudaVersions` and
`gpu.minCudaVersion` — so a CPU create cannot express them and the
schema rejects the attempt with a 422. A non-empty set and a floor are
mutually exclusive (400 if both are sent); an explicit empty set states
no constraint and may accompany a floor.

Returns `201` with the created endpoint. The endpoint can accept jobs
immediately, but starts with no active workers unless `workers.min`
is greater than 0. Workers are provisioned on demand and autoscaled
between `workers.min` and `workers.max` according to the `scaling`
policy, so the first request to an idle endpoint may incur cold-start
latency while a worker pulls its image and boots.

## Checking what you can deploy

`gpu.pools` takes serverless GPU **pool** IDs, not the GPU type IDs
used for pods. `gpu.excludedTypes` takes the type IDs — it subtracts
specific cards from the pools you picked. Read both from the catalog
before you create:

- [List GPU types](https://docs.runpod.io/api-reference-v2/catalog/list-gpu-types)
  — the `pool` field carries the pool ID for each GPU type (`null`
  means that type is not in a serverless pool). Add
  `include=AVAILABILITY&product=SERVERLESS` for current serverless
  stock.
- [List data centers](https://docs.runpod.io/api-reference-v2/catalog/list-data-centers)
  — locations to constrain with `dataCenterIds`, with
  `include=GPU_AVAILABILITY` for stock per data center.

Unlike pod creation, you do not need to retry across GPUs yourself:
list every pool you are willing to run on and workers are placed on
whichever one has capacity. Listing more pools — and leaving
`dataCenterIds` unset — gives the scheduler more room and reduces the
chance of workers failing to start when a single pool is exhausted.

If your workload needs a specific card, pick the pool that holds it and
exclude the rest of that pool with `gpu.excludedTypes`. Keep at least
one type in the selection — upstream rejects a selection that leaves
none.




## OpenAPI

````yaml post /v2/serverless
openapi: 3.1.0
info:
  title: Runpod REST API
  version: 2.0.0
  description: Runpod public REST API — v2
servers:
  - url: https://api.runpod.io
    description: Runpod API v2 production server
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Account-scoped settings and primitives (SSH public keys).
  - name: Pods
    description: GPU and CPU pod lifecycle, configuration, actions, and log streaming.
  - name: Serverless
    description: >-
      Serverless endpoint lifecycle, worker visibility, releases, and worker log
      streaming.
  - name: Templates
    description: Reusable pod and endpoint configuration templates.
  - name: Network Volumes
    description: Persistent network storage volumes for workloads.
  - name: Registries
    description: Container registry credentials used to pull private images.
  - name: Catalog
    description: Available GPU, CPU, data center, and public template catalog metadata.
  - name: Billing
    description: Billing history and usage cost records across resource types.
paths:
  /v2/serverless:
    post:
      tags:
        - Serverless
      summary: Create a serverless endpoint
      description: >
        Creates a serverless endpoint. Callers specify exactly one of `gpu` or

        `cpu`; neither or both returns 400. Container settings come from the

        body, from a serverless template referenced by `templateId` (body

        fields override the template's), or both; `image` is required unless

        `templateId` is set. See `CreateEndpointRequest` for the full body.


        The CUDA constraints live on `gpu` — `gpu.allowedCudaVersions` and

        `gpu.minCudaVersion` — so a CPU create cannot express them and the

        schema rejects the attempt with a 422. A non-empty set and a floor are

        mutually exclusive (400 if both are sent); an explicit empty set states

        no constraint and may accompany a floor.


        Returns `201` with the created endpoint. The endpoint can accept jobs

        immediately, but starts with no active workers unless `workers.min`

        is greater than 0. Workers are provisioned on demand and autoscaled

        between `workers.min` and `workers.max` according to the `scaling`

        policy, so the first request to an idle endpoint may incur cold-start

        latency while a worker pulls its image and boots.


        ## Checking what you can deploy


        `gpu.pools` takes serverless GPU **pool** IDs, not the GPU type IDs

        used for pods. `gpu.excludedTypes` takes the type IDs — it subtracts

        specific cards from the pools you picked. Read both from the catalog

        before you create:


        - [List GPU
        types](https://docs.runpod.io/api-reference-v2/catalog/list-gpu-types)
          — the `pool` field carries the pool ID for each GPU type (`null`
          means that type is not in a serverless pool). Add
          `include=AVAILABILITY&product=SERVERLESS` for current serverless
          stock.
        - [List data
        centers](https://docs.runpod.io/api-reference-v2/catalog/list-data-centers)
          — locations to constrain with `dataCenterIds`, with
          `include=GPU_AVAILABILITY` for stock per data center.

        Unlike pod creation, you do not need to retry across GPUs yourself:

        list every pool you are willing to run on and workers are placed on

        whichever one has capacity. Listing more pools — and leaving

        `dataCenterIds` unset — gives the scheduler more room and reduces the

        chance of workers failing to start when a single pool is exhausted.


        If your workload needs a specific card, pick the pool that holds it and

        exclude the rest of that pool with `gpu.excludedTypes`. Keep at least

        one type in the selection — upstream rejects a selection that leaves

        none.
      operationId: createEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEndpointRequest'
            examples:
              serverlessEndpoint:
                summary: Serverless GPU endpoint
                value:
                  name: image-generator
                  image: runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404
                  type: QUEUE
                  gpu:
                    pools:
                      - ADA_24
                    count: 1
                  workers:
                    min: 0
                    max: 5
                    idleTimeout: 5
                  scaling:
                    type: QUEUE_DELAY
                    queueDelay: 4
                  dataCenterIds:
                    - US-KS-2
                  timeout: 300000
              cpuServerlessEndpoint:
                summary: Serverless CPU endpoint with multiple configurations
                value:
                  name: cpu-inference
                  image: python:3.11-slim
                  type: QUEUE
                  cpu:
                    - id: cpu5c
                      vcpuCount: 4
                    - id: cpu5g
                      vcpuCount: 8
                  workers:
                    min: 0
                    max: 3
                    idleTimeout: 10
                  scaling:
                    type: QUEUE_DELAY
                    queueDelay: 4
                  timeout: 300000
      responses:
        '201':
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Endpoint'
              examples:
                endpoint:
                  summary: Successful response
                  value:
                    id: 4m7x2k9q
                    name: image-generator
                    type: QUEUE
                    requestUrls:
                      run: https://api.runpod.ai/v2/4m7x2k9q/run
                      runSync: https://api.runpod.ai/v2/4m7x2k9q/runsync
                      status: https://api.runpod.ai/v2/4m7x2k9q/status/{job_id}
                      stream: https://api.runpod.ai/v2/4m7x2k9q/stream/{job_id}
                      cancel: https://api.runpod.ai/v2/4m7x2k9q/cancel/{job_id}
                      retry: https://api.runpod.ai/v2/4m7x2k9q/retry/{job_id}
                      purgeQueue: https://api.runpod.ai/v2/4m7x2k9q/purge-queue
                      health: https://api.runpod.ai/v2/4m7x2k9q/health
                    image: runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404
                    args: ''
                    disk: 20
                    ports:
                      - 8000/http
                    env:
                      MODEL_NAME: sdxl
                    registry: null
                    gpu:
                      pools:
                        - ADA_24
                      count: 1
                      allowedCudaVersions: []
                      minCudaVersion: null
                    workers:
                      min: 0
                      max: 5
                      idleTimeout: 5
                    scaling:
                      type: QUEUE_DELAY
                      queueDelay: 4
                    dataCenterIds:
                      - US-KS-2
                    networkVolumes:
                      - 2q9m7x4c
                    timeout: 300000
                    flashboot: 'OFF'
                    createdAt: '2026-06-01T12:00:00Z'
                cpuEndpoint:
                  summary: Successful response for a CPU endpoint
                  value:
                    id: 7c3v1n8p
                    name: cpu-inference
                    type: QUEUE
                    requestUrls:
                      run: https://api.runpod.ai/v2/7c3v1n8p/run
                      runSync: https://api.runpod.ai/v2/7c3v1n8p/runsync
                      status: https://api.runpod.ai/v2/7c3v1n8p/status/{job_id}
                      stream: https://api.runpod.ai/v2/7c3v1n8p/stream/{job_id}
                      cancel: https://api.runpod.ai/v2/7c3v1n8p/cancel/{job_id}
                      retry: https://api.runpod.ai/v2/7c3v1n8p/retry/{job_id}
                      purgeQueue: https://api.runpod.ai/v2/7c3v1n8p/purge-queue
                      health: https://api.runpod.ai/v2/7c3v1n8p/health
                    image: python:3.11-slim
                    args: ''
                    disk: 20
                    ports: []
                    env: {}
                    registry: null
                    cpu:
                      - id: cpu5c
                        vcpuCount: 4
                        memory: 16
                      - id: cpu5g
                        vcpuCount: 8
                        memory: 16
                    workers:
                      min: 0
                      max: 3
                      idleTimeout: 10
                    scaling:
                      type: QUEUE_DELAY
                      queueDelay: 4
                    dataCenterIds: []
                    networkVolumes: []
                    timeout: 300000
                    flashboot: 'OFF'
                    createdAt: '2026-06-01T12:00:00Z'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableEntityError'
        '429':
          $ref: '#/components/responses/TooManyRequestsError'
        default:
          headers:
            RateLimit:
              $ref: '#/components/headers/RateLimit'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateEndpointRequest:
      allOf:
        - $ref: '#/components/schemas/ContainerConfig'
        - if:
            not:
              required:
                - templateId
          then:
            required:
              - image
        - type: object
          required:
            - name
            - type
            - scaling
          properties:
            gpu:
              $ref: '#/components/schemas/CreateEndpointGpuConfig'
            name:
              type: string
              minLength: 1
              examples:
                - my-inference
            scaling:
              $ref: '#/components/schemas/EndpointScaling'
            type:
              allOf:
                - $ref: '#/components/schemas/EndpointType'
              description: >
                Request-routing model. Required — it determines the valid scaler

                and request URLs, so it must be chosen explicitly on every
                create.
            cpu:
              type: array
              minItems: 1
              uniqueItems: true
              description: >
                Eligible CPU configurations for each worker. Memory is derived
                from the

                selected flavor's catalog RAM multiplier. Exact duplicate
                configurations

                are rejected; the same flavor may be listed at different vCPU
                counts.
              items:
                $ref: '#/components/schemas/CreateCpuConfig'
            dataCenterIds:
              type: array
              items:
                type: string
              description: >-
                Preferred data centers for placement. Omit or pass an empty
                array to let the scheduler choose.
            flashboot:
              allOf:
                - $ref: '#/components/schemas/FlashBoot'
              default: 'OFF'
            networkVolumes:
              type: array
              items:
                type: string
            templateId:
              type: string
              minLength: 1
              description: |
                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 `gpu.allowedCudaVersions` when the
                body omits it — but only for a GPU create, since a CPU endpoint
                has no gpu block to seed into, and not when the body sets
                `gpu.minCudaVersion`, since seeding a set beside a floor would
                manufacture the mutual-exclusion 400 from a valid request. 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).
              examples:
                - 30zmvf89kd
            timeout:
              type: integer
              default: 300000
            workers:
              allOf:
                - $ref: '#/components/schemas/EndpointWorkers'
              properties:
                min:
                  type: integer
                  default: 0
                max:
                  type: integer
                  default: 3
                idleTimeout:
                  type: integer
                  default: 10
      unevaluatedProperties: false
      if:
        required:
          - type
        properties:
          type:
            const: LOAD_BALANCER
      then:
        properties:
          scaling:
            $ref: '#/components/schemas/RequestCountScaling'
    Endpoint:
      allOf:
        - $ref: '#/components/schemas/ContainerConfig'
        - type: object
          required:
            - id
            - name
            - workers
            - scaling
            - dataCenterIds
            - networkVolumes
            - timeout
            - flashboot
            - createdAt
          properties:
            id:
              type: string
              examples:
                - ep_abc123
            name:
              type: string
              examples:
                - my-inference
            type:
              $ref: '#/components/schemas/EndpointType'
            requestUrls:
              $ref: '#/components/schemas/EndpointRequestUrls'
            gpu:
              anyOf:
                - $ref: '#/components/schemas/EndpointGpuConfig'
                - type: 'null'
            cpu:
              type: array
              minItems: 1
              description: |
                Eligible CPU configurations for each worker, in the order they
                were submitted. Present for CPU endpoints and omitted for GPU
                endpoints. Memory is derived from the selected flavor's catalog
                RAM multiplier.
              items:
                $ref: '#/components/schemas/CpuConfig'
            workers:
              allOf:
                - $ref: '#/components/schemas/EndpointWorkers'
              required:
                - min
                - max
            scaling:
              $ref: '#/components/schemas/EndpointScaling'
            dataCenterIds:
              type: array
              items:
                type: string
              examples:
                - - US-TX-3
            networkVolumes:
              type: array
              items:
                type: string
              examples:
                - - vol_abc
            timeout:
              type: integer
              description: Per-request execution timeout in milliseconds
              examples:
                - 300000
            flashboot:
              $ref: '#/components/schemas/FlashBoot'
            createdAt:
              type: string
              format: date-time
              examples:
                - '2026-03-13T20:00:00Z'
    ErrorResponse:
      type: object
      required:
        - title
        - status
        - detail
      properties:
        title:
          type: string
          description: Short human-readable summary
          examples:
            - Not Found
        status:
          type: integer
          description: HTTP status code
          examples:
            - 404
        detail:
          type: string
          description: Human-readable explanation
          examples:
            - pod not found
        errors:
          type: array
          description: Individual request-validation failures.
          items:
            type: string
          examples:
            - - '$: additional properties ''bogus'' not allowed'
    ContainerConfig:
      description: >
        Reusable container configuration shared across templates, pods, and
        serverless endpoints. Adding a field here automatically propagates to
        all three resources.
      allOf:
        - $ref: '#/components/schemas/BaseContainerConfig'
        - type: object
          properties:
            registry:
              type:
                - string
                - 'null'
              description: Container registry credential ID (for private images)
              examples:
                - null
    CreateEndpointGpuConfig:
      description: |
        GPU request for an endpoint create. Carries the CUDA constraints, which
        live here rather than at the body's top level so they are
        unrepresentable on a CPU endpoint.
      allOf:
        - $ref: '#/components/schemas/BaseEndpointGpuConfig'
        - type: object
          required:
            - pools
          properties:
            allowedCudaVersions:
              type: array
              items:
                type: string
                pattern: ^\d+\.\d+$
              description: |
                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&product=SERVERLESS`
                (`cudaVersions`).

                A non-empty set is mutually exclusive with minCudaVersion (400
                if both are sent). An explicit `[]` states no constraint, so it
                may accompany a floor.
              examples:
                - - '12.8'
                  - '12.6'
            minCudaVersion:
              type: string
              pattern: ^\d+\.\d+$
              description: |
                Lowest acceptable CUDA version for worker placement, as
                `major.minor`, compared numerically rather than as a decimal —
                so 12.11 is above 12.2. Use this for an open-ended floor and
                allowedCudaVersions for an exact set.

                Mutually exclusive with a non-empty allowedCudaVersions (400 if
                both are sent); an explicit `[]` there states no constraint and
                may accompany this floor.
              examples:
                - '12.1'
      unevaluatedProperties: false
    EndpointScaling:
      description: |
        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.
      oneOf:
        - $ref: '#/components/schemas/QueueDelayScaling'
        - $ref: '#/components/schemas/RequestCountScaling'
      discriminator:
        propertyName: type
        mapping:
          QUEUE_DELAY:
            $ref: '#/components/schemas/QueueDelayScaling'
          REQUEST_COUNT:
            $ref: '#/components/schemas/RequestCountScaling'
    EndpointType:
      type: string
      description: >
        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`).
      x-enum-varnames:
        - EndpointTypeQueue
        - EndpointTypeLoadBalancer
      enum:
        - QUEUE
        - LOAD_BALANCER
    CreateCpuConfig:
      allOf:
        - $ref: '#/components/schemas/BaseCpuConfig'
      unevaluatedProperties: false
    FlashBoot:
      type: string
      description: |
        FlashBoot cold-start acceleration mode.
        - `OFF`                — disabled
        - `FLASHBOOT`          — enabled
        - `PRIORITY_FLASHBOOT` — enabled with priority capacity
      enum:
        - 'OFF'
        - FLASHBOOT
        - PRIORITY_FLASHBOOT
    EndpointWorkers:
      type: object
      additionalProperties: false
      properties:
        min:
          type: integer
          minimum: 0
          description: Minimum number of workers.
          examples:
            - 0
        max:
          type: integer
          minimum: 0
          description: Maximum number of workers.
          examples:
            - 5
        idleTimeout:
          type: integer
          minimum: 1
          maximum: 3600
          description: >
            Seconds before idle workers scale down. Not applicable to
            queue-based

            endpoints scaling on `requestCount` — rejected on create/update and

            omitted from responses for that combination.
          examples:
            - 5
    RateLimitHeader:
      type: string
      description: |
        Live per-window quota state. Optional — omitted for rate-limit-exempt
        callers.

        A structured-field list with one member per window (`minute`, `hour`,
        `day`), each carrying the remaining request count `r` and seconds until
        the window resets `t`. Returned on responses to authenticated requests,
        not only on 429s.
      examples:
        - '"minute";r=0;t=12, "hour";r=2800;t=1812, "day";r=49500;t=45012'
    RateLimitPolicyHeader:
      type: string
      description: >
        Static per-window quota policy. Optional — omitted for rate-limit-exempt

        callers.


        A structured-field list with one member per window (`minute`, `hour`,

        `day`), each carrying the quota `q` and the window length in seconds
        `w`.

        Returned on responses to authenticated requests, not only on 429s.
      examples:
        - '"minute";q=60;w=60, "hour";q=3000;w=3600, "day";q=50000;w=86400'
    EndpointRequestUrls:
      description: |
        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.
      oneOf:
        - $ref: '#/components/schemas/QueueBasedRequestUrls'
        - $ref: '#/components/schemas/LoadBalancingRequestUrls'
    EndpointGpuConfig:
      allOf:
        - $ref: '#/components/schemas/BaseEndpointGpuConfig'
        - type: object
          required:
            - pools
            - allowedCudaVersions
            - minCudaVersion
          properties:
            allowedCudaVersions:
              type: array
              items:
                type: string
              description: >-
                Acceptable CUDA versions for worker placement, as `major.minor`.
                Empty means any version.
              examples:
                - []
            minCudaVersion:
              type:
                - string
                - 'null'
              description: >-
                Lowest acceptable CUDA version for worker placement, as
                `major.minor`. Null means no floor.
              examples:
                - null
    CpuConfig:
      allOf:
        - $ref: '#/components/schemas/BaseCpuConfig'
        - type: object
          required:
            - memory
          properties:
            memory:
              type: integer
              minimum: 1
              description: Memory allocated to the pod in GB.
              examples:
                - 16
    BaseContainerConfig:
      type: object
      description: >
        Container configuration universal to every containerized resource.
        Compose ContainerConfig instead unless the resource cannot support
        private registries (clusters, until the upstream input accepts a
        registry credential).
      properties:
        args:
          type: string
          description: Arguments passed to the container entrypoint
          examples:
            - ''
        disk:
          type: integer
          minimum: 1
          description: Container disk in GB (ephemeral, wiped on restart)
          examples:
            - 50
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables as key-value pairs
          examples:
            - JUPYTER_PASSWORD: hunter2
        image:
          type: string
          description: Docker image reference
          examples:
            - runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404
        ports:
          type: array
          description: Exposed ports, formatted as port/protocol
          items:
            type: string
          examples:
            - - 8888/http
              - 22/tcp
    BaseEndpointGpuConfig:
      type: object
      properties:
        pools:
          type: array
          minItems: 1
          description: |
            Serverless GPU pool IDs (as returned by `GET /v2/catalog/gpus` in
            `pool`). Workers are placed on whichever listed pool has capacity.
            Narrow a pool down to specific cards with `excludedTypes`.
          items:
            type: string
          examples:
            - - ADA_24
        excludedTypes:
          type: array
          uniqueItems: true
          description: >
            GPU **type** IDs to subtract from the selected pools — the `id`

            field of `GET /v2/catalog/gpus`, the same identifiers pods take in

            `gpu.id`. Workers run on every type in `pools` except these. Omit to

            use the whole pool.


            Pools stay the unit of selection; types are the unit of

            subtraction. There is no inclusive allowlist: a card later added to

            one of your pools becomes eligible, which is the honest reading of

            "this pool, minus these".


            Tied to `pools`, because the two together are one selection:

            supplying `pools` replaces that selection wholesale, so a `PATCH`

            sending `pools` **without `excludedTypes`** **clears** them —

            restate them to keep them. A `PATCH` that omits `pools` leaves both

            the pools and the exclusions untouched, so changing only a CUDA

            constraint cannot widen a pinned endpoint.


            Rejected with 400 if a value is not a GPU type in one of `pools`;

            upstream accepts unrecognized exclusions silently, so a typo would

            otherwise produce a filter that does nothing. Surrounding whitespace

            is trimmed, so `" NVIDIA L40"` and `"NVIDIA L40"` mean the same
            card.
          items:
            type: string
            pattern: ^\s*[^-\s]
          examples:
            - - NVIDIA L40
        count:
          type: integer
          minimum: 1
          default: 1
          description: GPUs per worker
          examples:
            - 1
    QueueDelayScaling:
      type: object
      additionalProperties: false
      description: Scale on queue wait time. Queue-based endpoints only.
      required:
        - type
        - queueDelay
      properties:
        type:
          type: string
          description: Scaler discriminator. Always `QUEUE_DELAY` for this variant.
          enum:
            - QUEUE_DELAY
        queueDelay:
          type: number
          format: float
          minimum: 0.5
          description: >-
            Adjusts the number of workers based on how long requests wait in the
            queue.
          examples:
            - 4
    RequestCountScaling:
      type: object
      additionalProperties: false
      description: |
        Scale on concurrent in-flight requests per worker. Required for
        load-balancing endpoints; also selectable for queue-based.
      required:
        - type
        - requestCount
      properties:
        type:
          type: string
          description: Scaler discriminator. Always `REQUEST_COUNT` for this variant.
          enum:
            - REQUEST_COUNT
        requestCount:
          type: integer
          minimum: 1
          description: Adjusts the number of workers based on active in-flight requests.
          examples:
            - 4
    BaseCpuConfig:
      type: object
      required:
        - id
        - vcpuCount
      properties:
        id:
          type: string
          description: CPU flavor identifier, as returned by GET /v2/catalog/cpus.
          examples:
            - cpu5c
          minLength: 1
        vcpuCount:
          type: integer
          minimum: 2
          description: >-
            Number of vCPUs. Must be valid for the selected CPU flavor and must
            be a power of two.
          examples:
            - 4
    QueueBasedRequestUrls:
      type: object
      additionalProperties: false
      required:
        - run
        - runSync
        - status
        - stream
        - cancel
        - retry
        - purgeQueue
        - health
      properties:
        run:
          type: string
          format: uri
          description: URL for asynchronously submitting a queued job.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/run
        runSync:
          type: string
          format: uri
          description: >-
            URL for synchronously submitting a queued job. Accepts an optional
            `?wait=x` query parameter to control how long the request waits for
            job completion, defaulting to 90 seconds.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/runsync
        status:
          type: string
          format: uri
          description: >-
            Check the current state, execution statistics, and results of a
            previously submitted job.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/status/{job_id}
        stream:
          type: string
          format: uri
          description: >-
            Receive incremental results as they become available from a job that
            generates output progressively.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/stream/{job_id}
        cancel:
          type: string
          format: uri
          description: Stop an in-progress job or remove a queued job before it starts.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/cancel/{job_id}
        retry:
          type: string
          format: uri
          description: Requeue a failed or timed-out job without submitting a new request.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/retry/{job_id}
        purgeQueue:
          type: string
          format: uri
          description: >-
            Remove all pending jobs from the queue. Does not affect in-progress
            jobs.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/purge-queue
        health:
          type: string
          format: uri
          description: Overview of an endpoint's operational status.
          examples:
            - https://api.runpod.ai/v2/4m7x2k9q/health
    LoadBalancingRequestUrls:
      type: object
      additionalProperties: false
      required:
        - base
        - health
      properties:
        base:
          type: string
          format: uri
          description: Base URL for worker-defined HTTP and WebSocket paths.
          examples:
            - https://4m7x2k9q.api.runpod.ai
        health:
          type: string
          format: uri
          description: >-
            Health check endpoint the load balancer will periodically ping to
            decide if the worker is healthy enough to receive traffic.
            Configurable by setting the `HEALTH_CHECK_PATH` environment
            variable. Defaults to `/ping` if the variable is not set.
          examples:
            - https://4m7x2k9q.api.runpod.ai/ping
  headers:
    RateLimit:
      schema:
        $ref: '#/components/schemas/RateLimitHeader'
    RateLimit-Policy:
      schema:
        $ref: '#/components/schemas/RateLimitPolicyHeader'
  responses:
    BadRequestError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The request could not be processed because it is malformed or conflicts
        with request rules.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            badRequest:
              summary: Bad request
              value:
                title: Bad Request
                status: 400
                detail: request could not be processed
    UnauthorizedError:
      description: >-
        Authentication failed because the bearer token is missing, malformed,
        expired, or invalid.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingBearerToken:
              summary: Missing bearer token
              value:
                title: Unauthorized
                status: 401
                detail: missing bearer token
    ForbiddenError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The bearer token is valid, but it does not grant access to the requested
        resource or action.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientAccess:
              summary: Insufficient access
              value:
                title: Forbidden
                status: 403
                detail: access denied
    NotFoundError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: The requested resource was not found or is not accessible to the caller.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notFound:
              summary: Resource not found
              value:
                title: Not Found
                status: 404
                detail: resource not found
    UnprocessableEntityError:
      headers:
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      description: >-
        The request body or parameters were syntactically valid but failed
        validation.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validationFailed:
              summary: Validation failed
              value:
                title: Unprocessable Entity
                status: 422
                detail: Request validation failed.
    TooManyRequestsError:
      description: >
        The caller exceeded its per-user rate limit. The response identifies the
        window that was exceeded and how long to wait. The `RateLimit` and
        `RateLimit-Policy` headers (per the IETF ratelimit-headers draft) also
        accompany successful responses, so clients can track quota before a 429.
      headers:
        Retry-After:
          description: Seconds to wait before retrying, per the exceeded window.
          schema:
            type: integer
          example: 12
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              summary: Rate limit exceeded
              value:
                title: Too Many Requests
                status: 429
                detail: rate limit exceeded for the minute window
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Runpod API Key
      description: >
        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.

````