{
  "openapi": "3.0.3",
  "info": {
    "title": "Runware Serverless API - GPU types",
    "version": "0.6.0",
    "description": "The GPU catalog an application's configuration selects from, with pricing."
  },
  "servers": [
    {
      "url": "https://api.serverless.runware.ai"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "OrgJwtAuth": []
    }
  ],
  "paths": {
    "/v1/gpu-types": {
      "get": {
        "tags": [
          "Compute"
        ],
        "summary": "List supported GPU types and their pricing",
        "description": "Returns the global GPU type catalog and pricing. The request requires authentication. Customer principals receive only GPU types with capacity currently offered to customers. A type whose hardware is not yet cleared for customer workloads is omitted. The Runware principal receives the full catalog, including retired types and types not yet offered. Retired entries carry `deletedAt`. Each entry's `pricing` is the price currently in effect.\n",
        "operationId": "listGpuTypes",
        "responses": {
          "200": {
            "description": "GPU type catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GpuTypeList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/gpu-types/{gpuTypeId}": {
      "get": {
        "tags": [
          "Compute"
        ],
        "summary": "Get a GPU type from the catalog",
        "description": "Returns an active entry from the global GPU type catalog. Retired entries return `404`. The result is not organization-specific, but the request still requires authentication.\n",
        "operationId": "getGpuType",
        "parameters": [
          {
            "$ref": "#/components/parameters/GpuTypeId"
          }
        ],
        "responses": {
          "200": {
            "description": "The GPU type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GpuType"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GpuTypeList": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GpuType"
            }
          }
        }
      },
      "GpuType": {
        "type": "object",
        "required": [
          "id",
          "name",
          "memory",
          "availability",
          "multiGpuSupport",
          "gpusPerWorker",
          "pricing"
        ],
        "properties": {
          "id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GpuTypeId"
              }
            ],
            "description": "Public catalog code referenced by `gpuType` in worker configuration (not the internal database row UUID).\n"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\S(.*\\S)?$",
            "example": "H100"
          },
          "memory": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\S(.*\\S)?$",
            "description": "Human-readable memory capacity.",
            "example": "80 GB HBM"
          },
          "availability": {
            "$ref": "#/components/schemas/GpuAvailability"
          },
          "multiGpuSupport": {
            "type": "boolean",
            "description": "Whether a worker on this GPU type may be granted more than one GPU. `false` means a count above 1 is rejected, and `gpusPerWorker` on this object is at most `[1]`. `true` does not mean every count above 1 is accepted: `gpusPerWorker` lists the counts an admitted pool serves.\n"
          },
          "gpusPerWorker": {
            "type": "array",
            "minItems": 0,
            "uniqueItems": true,
            "description": "The `configuration.gpusPerWorker` counts an admitted pool of this type serves, in ascending order. A pool with no pin serves 1, 2, 4 and 8. A pool pinned to a set size serves only that count. `multiGpuSupport` false leaves only 1, and only when a pool serves 1. An empty array means no count is accepted. Read this before creating an app. A count absent from this array is rejected with a 422 naming `/configuration/gpusPerWorker` and detail `must be one of the gpusPerWorker counts GPU type \"<id>\" serves: <counts>`, or `GPU type \"<id>\" serves no gpusPerWorker count` when this array is empty. List and get leave out a count above 1 when every admitted pool of the type shares one cluster and that cluster has published worker shapes that omit it. Submitting that count is a 422 with detail `must be one of the worker shapes available for GPU type \"<id>\": <shapes>`, or `no multi-GPU worker shape is available for GPU type \"<id>\"` when that cluster grants none. A write of this object returns the pool-served counts, before that shape pass. A cluster that has published no shapes accepts a count this array lists. Admitted pools that span more than one cluster leave this array at the pool-served counts, and create checks the cluster of the pool it picks. `multiGpuSupport` false rejects a count above 1 on the primary type with detail `GPU type \"<id>\" does not support multiple GPUs per worker`, before this array is consulted. The same refusal for the fallback type is `fallback GPU type \"<id>\" does not support multiple GPUs per worker`.\n",
            "items": {
              "type": "integer",
              "format": "int32",
              "enum": [
                1,
                2,
                4,
                8
              ]
            }
          },
          "deletedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Retirement time, returned only in the Runware catalog view."
          },
          "pricing": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GpuPricing"
              }
            ],
            "description": "The price currently in effect, the most recent price whose effectiveFrom is not in the future. The Runware principal can read the full price history, including scheduled future changes, from `GET /v1/gpu-types/{gpuTypeId}/prices`.\n"
          }
        }
      },
      "GpuTypeId": {
        "type": "string",
        "description": "Public catalog code for a supported GPU type (e.g. `h100`, `rtx-pro-6000`). Must match an `id` returned by `GET /v1/gpu-types` (validated at request time against the catalog). This is not the internal database row UUID.\n",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[a-z][a-z0-9_-]{0,63}$"
      },
      "GpuAvailability": {
        "type": "string",
        "description": "How the catalog currently offers this GPU type. `restricted` means the SKU is not generally available. It is not purchased reserved capacity.\n",
        "enum": [
          "available",
          "restricted",
          "custom"
        ]
      },
      "GpuPricing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "perSecond",
          "effectiveFrom"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "perSecond": {
            "type": "string",
            "minLength": 1,
            "pattern": "^\\d+\\.\\d+$",
            "description": "Price per GPU per second in USD major units as an exact decimal string (e.g. \"0.000767\"). Stored and billed from nanodollars internally. The platform bills in USD only.\n",
            "example": "0.000767"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date-time",
            "description": "From when this price is effective."
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "description": "RFC 9457 problem details. Every error response from this API uses this schema with media type `application/problem+json`. `type` is a URI that identifies the problem class and dereferences to its documentation. Clients should switch on `type` (not `status` or `detail`, which are not stable identifiers). Additional members beyond those below may appear.\n",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "default": "about:blank",
            "description": "URI reference identifying the problem type. Dereferences to human-readable documentation. `about:blank` denotes \"no semantics beyond the HTTP status\".\n",
            "example": "https://docs.runware.ai/serverless/errors#not-found"
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type (the standard HTTP status text). Stable for a given `type`. Does not change from occurrence to occurrence.\n",
            "example": "Not Found"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code generated for this occurrence.",
            "example": 404
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation specific to this occurrence.",
            "example": "No app 'img-gen' exists for the authenticated organization."
          },
          "instance": {
            "type": "string",
            "format": "uri-reference",
            "description": "URI reference identifying the specific occurrence (the request path).",
            "example": "/v1/apps/img-gen"
          },
          "requestId": {
            "type": "string",
            "description": "Extension member. Correlation id for this request, echoed in the `X-Request-Id` response header. Quote it when reporting problems.\n"
          },
          "endpointPath": {
            "type": "string",
            "description": "Extension member. Present on a `404` from task invocation when the app exists but does not declare the requested endpoint path. Its presence distinguishes an unknown endpoint from an unknown app. Carries the rejected path.\n",
            "example": "generate"
          },
          "errors": {
            "type": "array",
            "description": "Extension member. Present when the rejection names the fields it refused: on a `422`, on a `400` for a parameter or a `container.yaml` that could not be parsed, and on a `409` from `POST /v1/secret-batches` or `POST /v1/secrets/{secretName}/copy` when one or more names are already taken. One entry per field.\n",
            "items": {
              "$ref": "#/components/schemas/ProblemError"
            }
          },
          "limit": {
            "type": "string",
            "description": "The violated Shared Volume limit on a volume-limit-exceeded conflict."
          },
          "cap": {
            "type": "integer",
            "format": "int64",
            "description": "The organization's effective cap for the named limit."
          },
          "current": {
            "type": "integer",
            "format": "int64",
            "description": "The current value considered by Shared Volume admission."
          },
          "requested": {
            "type": "integer",
            "format": "int64",
            "description": "The requested value or increase, as identified by requestedIsIncrement."
          },
          "requestedIsIncrement": {
            "type": "boolean",
            "description": "Whether requested is an increase to current rather than an absolute value."
          },
          "shortfall": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MoneyAmount"
              }
            ],
            "description": "Extension member. Present on an `insufficient-credit` or a `credit-suspended` problem (`402`): the amount to add to the organization's balance before retrying. The request is unchanged by the refusal and succeeds as sent once the credit is there. Read this rather than parsing `detail`.\n"
          }
        }
      },
      "ProblemError": {
        "type": "object",
        "description": "A single field-level validation error within a ProblemDetails.",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "description": "Human-readable reason this field was rejected.",
            "example": "is required"
          },
          "pointer": {
            "type": "string",
            "description": "JSON Pointer (RFC 6901) to the offending field in the request body, e.g. `/configuration/maxWorkers`. Absent for non-body parameters.\n",
            "example": "/configuration/maxWorkers"
          },
          "configPointer": {
            "type": "string",
            "description": "JSON Pointer (RFC 6901) to the offending field inside a document the request carried, rather than in the request body itself: a container source's `container.yaml`. On such a rejection `pointer` names where the archive sat in the request body and this member names the field inside the document. A Dockerfile line uses the same member, as `/Dockerfile/line/{n}` with n 1-based. A rejection about the archive rather than the document carries no `configPointer`, because nothing was parsed.\n",
            "example": "/endpoints/0/path"
          }
        }
      },
      "MoneyAmount": {
        "type": "object",
        "description": "A monetary amount as an exact decimal string in the currency's major unit. Money is never represented as a float (see `GpuPricing.perSecond`).\n",
        "required": [
          "amount",
          "currency"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+$",
            "description": "Amount in major units as an exact decimal string.",
            "example": "312.40"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "Currency": {
        "type": "string",
        "description": "ISO 4217 alphabetic code. The platform bills in USD only.",
        "enum": [
          "USD"
        ]
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid credentials",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            },
            "examples": {
              "unauthorized": {
                "summary": "No usable credential",
                "value": {
                  "type": "https://docs.runware.ai/serverless/errors#unauthorized",
                  "title": "Unauthorized",
                  "status": 401,
                  "detail": "Missing or invalid credentials"
                }
              }
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Unexpected server error",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            },
            "examples": {
              "internal-server-error": {
                "summary": "Unexpected failure",
                "value": {
                  "type": "https://docs.runware.ai/serverless/errors#internal-server-error",
                  "title": "Internal Server Error",
                  "status": 500,
                  "detail": "Internal Server Error"
                }
              }
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "A required service is temporarily unavailable",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            },
            "examples": {
              "service-unavailable": {
                "summary": "A dependency is temporarily unreachable",
                "value": {
                  "type": "https://docs.runware.ai/serverless/errors#service-unavailable",
                  "title": "Service Unavailable",
                  "status": 503,
                  "detail": "Authentication service is temporarily unavailable"
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            },
            "examples": {
              "not-found": {
                "summary": "The resource does not exist",
                "value": {
                  "type": "https://docs.runware.ai/serverless/errors#not-found",
                  "title": "Not Found",
                  "status": 404,
                  "detail": "app not found"
                }
              }
            }
          }
        }
      },
      "ValidationError": {
        "description": "The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns `400`. The `errors` array carries one entry per offending field.\n",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            },
            "examples": {
              "unprocessable-entity": {
                "summary": "A field broke the schema",
                "value": {
                  "type": "https://docs.runware.ai/serverless/errors#unprocessable-entity",
                  "title": "Unprocessable Entity",
                  "status": 422,
                  "detail": "/configuration/maxWorkers: number must be at least 1",
                  "errors": [
                    {
                      "detail": "number must be at least 1",
                      "pointer": "/configuration/maxWorkers"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "GpuTypeId": {
        "name": "gpuTypeId",
        "in": "path",
        "required": true,
        "description": "Public catalog code for a GPU type (e.g. `h100`), not the internal row UUID.",
        "schema": {
          "$ref": "#/components/schemas/GpuTypeId"
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Runware API key supplied as a bearer token. Validated server-to-server against the existing Runware platform. The key identifies the organization.\n"
      },
      "OrgJwtAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Org-scoped JWT supplied as a bearer token, minted by the Runware platform for one user acting in one organization and verified locally against the platform's published JWKS. Serves the web app. The CLI and SDK use ApiKeyAuth.\n"
      }
    }
  }
}