KServe Models API

The Models API from KServe — 7 operation(s) for models.

OpenAPI Specification

kserve-models-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: KServe Inference Protocol Health Models API
  version: v1+v2
  description: 'Standardized model inference HTTP protocol exposed by KServe model

    servers. Endpoints below cover both the V1 Data Plane (prediction-style)

    and the V2 Data Plane (Open Inference Protocol). Endpoint paths

    transcribed from the public KServe documentation.

    '
  contact:
    name: Kin Lane
    email: kin@apievangelist.com
    url: https://apievangelist.com
  license:
    name: Documentation reference only
    url: https://kserve.github.io/website/docs/concepts/architecture/data-plane/v2-protocol
servers:
- url: http://{host}
  description: KServe inference service ingress (cluster- or gateway-specific)
  variables:
    host:
      default: model.example.com
security: []
tags:
- name: Models
paths:
  /v1/models:
    get:
      summary: List models (V1)
      operationId: v1ListModels
      responses:
        '200':
          description: List of models available on the server
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
  /v1/models/{model_name}:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    get:
      summary: Model ready (V1)
      operationId: v1ModelReady
      responses:
        '200':
          description: Model readiness
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
  /v1/models/{model_name}:predict:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    post:
      summary: Predict (V1)
      operationId: v1Predict
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: 'Either `{ "instances": [...] }` or `{ "inputs": ... }` as

                defined by the V1 data plane.

                '
      responses:
        '200':
          description: Prediction response
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
  /v1/models/{model_name}:explain:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    post:
      summary: Explain (V1)
      operationId: v1Explain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Explanation response
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
  /v2/models/{model_name}:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    get:
      summary: Model metadata (V2)
      operationId: v2ModelMetadata
      responses:
        '200':
          description: Model metadata
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
  /v2/models/{model_name}/ready:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    get:
      summary: Model readiness (V2)
      operationId: v2ModelReady
      responses:
        '200':
          description: Model is ready
      tags:
      - Models
  /v2/models/{model_name}/infer:
    parameters:
    - $ref: '#/components/parameters/ModelName'
    post:
      summary: Inference (V2 Open Inference Protocol)
      operationId: v2Infer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Open Inference Protocol inference request.
      responses:
        '200':
          description: Inference response
          content:
            application/json:
              schema:
                type: object
      tags:
      - Models
components:
  parameters:
    ModelName:
      in: path
      name: model_name
      required: true
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'KServe itself does not mandate an auth scheme; in production the

        InferenceService is typically fronted by an ingress/gateway that

        enforces auth (for example, Istio with OIDC/JWT, Knative serving

        with Kubernetes auth, or an API gateway). Bearer tokens are the

        most common production pattern.

        '