openapi: '3.0.0'
info:
  title: H2O Scoring API
  description: REST API for H2O model scoring. Common spec for all H2O.ai scoring runtimes.
  contact:
    email: support@h2o.ai
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  version: 1.5.0
servers:
  # Relative to the URL the spec is served from, so Swagger UI's "Execute"
  # targets the deployment's own base path (e.g. https://host/<deployment-id>/)
  # rather than the host root. A root-absolute "/" would drop the prefix that
  # the deployment proxy adds. See swagger-ui.html for the matching asset fix.
  - url: .
paths:
  /model/id:
    get:
      tags:
        - metadata
      summary: Returns model id
      description: Returns unique id of the model loaded in the server and used for scoring
      operationId: getModelId
      responses:
        "200":
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/schema:
    get:
      tags:
        - metadata
      summary: Describe a model
      description: "Returns information about the model used for scoring, e.g., input schema."
      operationId: getModelInfo
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /readyz:
    get:
      tags:
        - health
      summary: Readiness check
      description: Checks if the model schema can be retrieved successfully.
      operationId: getReadyz
      responses:
        "200":
          description: Model is ready
          content:
            text/plain:
              schema:
                type: string
        "503":
          description: Service Unavailable — model not ready or worker not responding
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/sample_request:
    get:
      tags:
        - metadata
      summary: Sample scoring request
      description: Builds a sample scoring request that would pass all validations
      operationId: getSampleRequest
      parameters:
        - name: for
          in: query
          required: false
          description: >-
            Selects which endpoint the sample targets. `score` (default)
            returns a sample for POST /model/score. `media-score` returns the
            `scoreMediaRequest` JSON part for POST /model/media-score:
            `mediaFields` populated with the model's declared media columns
            (or the `mediaFields` override) and those columns holding
            placeholder filenames instead of real content — a sample carries
            the reference contract only, never binary payload. `media-score`
            fails with 400 when the model declares no media input fields and no
            `mediaFields` override is given.
          schema:
            type: string
            enum:
              - score
              - media-score
        - name: format
          in: query
          required: false
          description: >-
            Pins the shape of the returned sample, independently of `for`.
            `records` always returns a records-shaped sample (`{"records":
            [...]}`): for flat models the columnar sample is transposed, scalar
            values staying in their string form, so the result is replayable.
            `columnar` returns the `fields`/`rows` shape and fails with 400 for
            models with composite (Array/Object) input or output, which cannot
            be represented in columnar form (such models report the
            `RECORDS_ONLY` capability at GET /model/capabilities). When omitted,
            the shape depends on the model schema: records for composite models,
            columnar otherwise.
          schema:
            type: string
            enum:
              - records
              - columnar
        - name: mediaFields
          in: query
          required: false
          description: >-
            Comma-separated input column names to treat as media columns.
            Meaningful only with `for=media-score` (ignored otherwise):
            overrides the model's declared media fields, so a working media
            sample can be produced for models that declare none. Named columns
            must exist in the input schema and be of type Str or Bytes;
            otherwise the request fails with 400.
          schema:
            type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ScoreRequest'
                  - $ref: '#/components/schemas/scoreMediaRequest'
        "400":
          description: Unknown for/format value, the requested format cannot represent this model's sample (columnar for a composite model), for=media-score for a model with no known media fields, or an invalid mediaFields override
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/capabilities:
    get:
      tags:
        - metadata
      summary: List capabilities supported by the scorer.
      description: Returns the capabilities supported by the scorer.
      operationId: getCapabilities
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CapabilityType'
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/score:
    post:
      tags:
        - scoring
      summary: Score on given rows
      description: Computes score of the rows sent in the body of the post request
      operationId: getScore
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScoreRequest'
            examples:
              columnar:
                summary: Columnar (fields/rows) request
                value:
                  fields: ["age", "income"]
                  rows: [["42", "50000"]]
              records:
                summary: Record-oriented request
                value:
                  records: [{"age": 42, "income": 50000}]
              compositeInput:
                summary: Records request with composite input values
                value:
                  records:
                    - embeddings: [0.12, 0.34]
                      address: {city: "Krakow"}
                      age: 42
        required: true
      responses:
        "200":
          description: Successful operation
          headers:
            X-Request-ID:
              $ref: '#/components/headers/XRequestID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreResponse'
              examples:
                columnar:
                  summary: Columnar (string-valued) response
                  value:
                    id: model-123
                    fields: ["prediction"]
                    score: [["0.85"]]
                records:
                  summary: Record-oriented (native-typed) response
                  value:
                    id: model-123
                    score: [{"prediction": 0.85}]
        "400":
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Scoring failed due to an internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "503":
          description: Service Unavailable — scoring pool exhausted or worker not responding
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/contribution:
    # x-required-capabilities (any-of semantics): a scorer omits this path from
    # the spec it serves at /openapi.json when the loaded model has none of the
    # listed capabilities. Paths without this extension are always served.
    x-required-capabilities: [CONTRIBUTION_ORIGINAL, CONTRIBUTION_TRANSFORMED]
    post:
      tags:
        - contribution
      summary: Contribution score or Shapley values on given rows
      description: Computes contribution score with the rows sent in the body of the post request
      operationId: getContribution
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContributionRequest'
        required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContributionResponse'
        "400":
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Contribution scoring failed due to an internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "501":
          description: Shapley contributions not supported by this model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "503":
          description: Service Unavailable — scoring pool exhausted or worker not responding
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /model/media-score:
    x-required-capabilities: [MEDIA]
    post:
      tags:
        - scoring
      summary: Score model with provided media files
      description: >-
        Computes score of provided data making use of provided media files.
        `includeFieldsInOutput` and `idField` behave exactly as on
        `/model/score`: fields are echoed in the output in the order they are
        listed in `includeFieldsInOutput`, and an absent `idField` may be
        generated as a UUID. For a media column, the echoed value is the
        uploaded file name as sent in the request — never the transformed
        media content.
        `requestShapleyValueType` (other than `NONE`) and
        `requestPredictionIntervals` have no media wire format and are
        rejected with 400.
      operationId: getMediaScore
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                scoreMediaRequest:
                  $ref: '#/components/schemas/scoreMediaRequest'
                files:
                  type: array
                  items:
                    type: string
                    format: binary
              required:
                - scoreMediaRequest
                - files
      responses:
        '200':
          description: Successful scoring operation
          headers:
            X-Request-ID:
              $ref: '#/components/headers/XRequestID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreResponse'
        '400':
          description: Invalid payload (missing form field, invalid JSON, or no files provided)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — returned by the security proxy when authentication is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity — media scoring failed due to invalid input data (e.g. bad image or unsupported format)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Media scoring failed due to an internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '501':
          description: Media scoring not supported by this model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable — scoring pool exhausted or worker not responding
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  headers:
    XRequestID:
      description: |
        Correlation id of this HTTP exchange. Echoes the caller's `X-Request-ID`
        request header when provided, otherwise a scorer-generated UUID. Identifies
        the whole request/response (all rows); use the `rowIds` response property
        for per-row identity.
      schema:
        type: string
  schemas:
    Model:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        properties:
          $ref: '#/components/schemas/Model_properties'
        schema:
          $ref: '#/components/schemas/ModelSchema'
    Row:
      type: array
      description: |
        Columnar result cells as strings. Non-finite floats use the canonical
        tokens "NaN" / "Infinity" / "-Infinity".
      items:
        type: string
    ScoreRecord:
      type: object
      description: |
        One scoring result row as an object mapping output field name to a native
        JSON value (number, boolean, string, array, object, or null). Returned when
        the request used record-oriented input. Non-finite floats serialize as the
        canonical strings "NaN" / "Infinity" / "-Infinity" (recursively inside
        composite values); null means NA or an echoed caller-sent null.
      additionalProperties: true
    ContributionRequest:
      required:
        - requestShapleyValueType
      type: object
      properties:
        requestShapleyValueType:
          $ref: '#/components/schemas/ShapleyType'
        fields:
          type: array
          description: |
            An array holding the names of fields in the order of appearance in the `rows` property. The length of `fields` has to match length of each row in `rows`. No duplicates are allowed.
          items:
            type: string
        rows:
          type: array
          description: |
            An array of rows consisting the actual input data for scoring, one scoring request per row.
          items:
            $ref: '#/components/schemas/Row'
        parameters:
          type: object
          description: |
            Optional key-value parameters passed through to the underlying scorer
            engine (e.g. fast_approx for DAI pipelines). Supported keys depend on
            the scorer implementation. Unrecognized keys, and parameters sent to a
            scorer that does not report the SCORE_PARAMETERS capability, are
            silently ignored. Values must be scalars (string, number, or boolean);
            requests with array or object values are rejected with 400.
          additionalProperties: true
    ContributionResponse:
      type: object
      properties:
        features:
          type: array
          description: |
            An array holding the names of fields in the order of appearance in the rows of the  `contributions` property.
          items:
            type: string
        contributionGroups:
          type: array
          description: |
            An array of rows consisting of the shapley contributions output corresponding to an output group.
          items:
            $ref: '#/components/schemas/ContributionGroup'
    ContributionGroup:
      type: object
      properties:
        outputGroup:
          type: string
          description: |
            Name of the output group. It will be populated only for multinomial models. Shapley values are not supported for third party models yet, hence this field will not be populated.
        contributions:
          type: array
          description: |
            An array of rows consisting of the shapley contributions output corresponding to columns in the fields
          items:
            $ref: '#/components/schemas/Row'
    ScoreRequest:
      type: object
      properties:
        requestShapleyValueType:
          $ref: '#/components/schemas/ShapleyType'
        includeFieldsInOutput:
          type: array
          description: |
            Field names to be copied from the input request row to the
            corresponding scoring output.

            **Name matching.** Entries are literal top-level field names.
            Unlike `idField`, they do not follow the shared field-naming
            contract: dots are not traversed and backticks are not quoting, so
            an entry is only ever matched against the field names as sent.
            Nested values are never projected into output columns.

            **Unknown names.** Every entry must name a column that exists in
            the request; anything else is a 400. One case creates a column
            that `fields` does not list: an `idField` that matches nothing and
            addresses a single dot-free name (`rid`, or the equivalent
            `` `rid` `` — with no interior dots to protect, the quoting is
            inert) generates row ids, and listing that name here echoes them
            as a column, same values as `rowIds`. An `idField` that addresses
            no such name generates no column, so listing it is a 400 — read
            its ids from `rowIds`. That covers a dot path (`a.b` traverses,
            naming no single column) and a quoted literal holding dots
            (`` `a.b` ``, where creating the column would fabricate a field
            the caller never sent). Reading is separate from creating: any
            `idField` that names a column already in `fields` — dotted or
            quoted included — may be listed, and echoes that column.

            **Divergence from `rowIds`.** Because the two properties resolve
            names independently, a records request carrying both a nested path
            and a literal top-level field of the same dotted spelling (say an
            `address` object with a `city` leaf alongside a literal
            `address.city` field) can echo a different value than it reports
            in `rowIds`. A bare dotted `idField` resolves traversal-first, so
            it reports the nested leaf on each row whose walk resolves and the
            literal field's cell on the rest, while the echoed column is the
            literal field on every row. Resolution is per row, so the two may
            agree on some rows and differ on others within one response. Both
            values are correct for what they describe; backtick-quote the
            `idField` to make it select the literal field on every row too.
            This only arises for records input — columnar cells are scalar
            strings, so a nested walk never resolves there and both sides
            always agree.

            **Ordering and typing.** The order of items in
            `includeFieldsInOutput` is ignored; fields are returned in their
            order of appearance in the input request row, and a generated row
            id — which appears in no input row — comes after them. In
            record-oriented responses the copied values are returned natively
            typed per the model's input schema (a generated row id stays a
            string); in columnar responses they are returned as the strings they
            arrived as. Composite (Array/Object) values are echoed as sent,
            including their elements — interior element typing is not rewritten.
          items:
            type: string
        noFieldNamesInOutput:
          type: boolean
          description: |
            If set to `true`. The scorer will not fill response column names in the `fields` field. This is can be useful to maintain compatibility with older scorer versions or to save bandwidth.
        idField:
          type: string
          description: |
            Name of the field that holds a row id — a value that uniquely
            identifies each row of the request. The name follows the shared
            field-naming contract: dots traverse nested object fields
            (`metadata.id` is the leaf `id` inside the object field `metadata`
            — meaningful for records requests carrying composite values), and
            a bare dotted name resolves traversal-first with the exact
            top-level field as a per-row fallback, so the nested path wins
            when a request carries both shapes; backtick-quoting forces a
            literal key that is not split on its dots (`` `metadata.id` ``)
            and never falls back, and a doubled backtick escapes a literal
            backtick. Arrays are leaves and are never indexed into. A
            resolved id value must be a scalar; a composite (array/object)
            value is rejected with a 400.

            Whenever `idField` is set, the per-row ids are returned in the
            response `rowIds` property: resolved values are echoed (a row
            where a dot path does not resolve — and no top-level field of the
            same dotted name exists to fall back to — yields a null id), and
            a name that matches nothing yields a generated UUID per row.
            Additionally listing the `idField`'s column in
            `includeFieldsInOutput` echoes the same values into the `score`
            rows (legacy behavior). That works for an `idField` naming a
            column already in `fields`, and for a generated id whose `idField`
            addresses a single dot-free name (`rid` and `` `rid` `` alike —
            inert quoting cannot change the outcome). An `idField` that
            addresses neither cannot be echoed: that combination is rejected
            with a 400, read the ids from `rowIds` instead.

            This naming contract applies to `idField` only.
            `includeFieldsInOutput` matches literal top-level field names and
            neither traverses dots nor treats backticks as quoting. So on a
            records request carrying both a nested path and a literal field of
            the same dotted spelling, `rowIds` (traversal-first: the nested
            leaf where the walk resolves, the literal cell elsewhere) and an
            echoed column of that spelling (always the literal field) can hold
            different values — decided per row, so they may agree on some rows
            and differ on others. Backtick-quote the `idField` to make both
            select the literal field.
        fields:
          type: array
          description: |
            An array holding the names of fields in the order of appearance in the `rows` property. The length of `fields` has to match length of each row in `rows`. No duplicates are allowed.
          items:
            type: string
        rows:
          type: array
          description: |
            An array of rows consisting the actual input data for scoring, one scoring request per row.
          items:
            $ref: '#/components/schemas/Row'
        records:
          type: array
          description: |
            Record-oriented input: one object per row mapping field name to a native
            JSON scalar (number, boolean, string, or null). Mutually exclusive with
            `fields`/`rows` — a request must use exactly one input shape. The response
            mirrors the request: records requests receive record-oriented, natively
            typed output in `score` (and no `fields` array); columnar requests receive
            the classic string-valued columnar output. Not compatible with
            `noFieldNamesInOutput`, `requestShapleyValueType` other than NONE, or
            `requestPredictionIntervals` (400). For models whose output schema
            declares composite (Array/Object) types, records requests return the
            composite values natively as JSON; columnar requests to such models
            are rejected (400) because a composite value has no faithful
            string-cell representation — use a records request to receive the
            native-typed output. Values are native JSON scalars (number, boolean,
            string, null). Scalar values may also be sent in their stringified
            form (e.g. "36" for an integer field): string scalars are accepted
            and coerced per the model's input schema, easing migration from the
            columnar shape. The response is always natively typed regardless of
            how scalars were sent, including fields echoed via
            `includeFieldsInOutput`. Fields the model's input schema declares as
            Array/Object (see DataField.dataType) must be native JSON
            arrays/objects — stringified composites are rejected.
            Models with composite input columns accept records requests only —
            columnar (fields/rows) requests are rejected with 400. Models
            subject to this rule (composite input or output) report the
            `RECORDS_ONLY` capability at GET /model/capabilities, so clients
            can pick the request format up front.
          items:
            type: object
            additionalProperties: true
        requestPredictionIntervals:
          type: boolean
          description: |
            If set to `true`, the scorer will try to fill field `predictionIntervals` in response if it is supported.
            Prediction interval columns are always included in `score`, appended after the
            prediction columns, regardless of this flag; setting it additionally returns them in
            the structured `predictionIntervals` field.
        parameters:
          type: object
          description: |
            Optional key-value parameters passed through to the underlying scorer
            engine (e.g. fast_approx for DAI pipelines). Supported keys depend on
            the scorer implementation. Unrecognized keys, and parameters sent to a
            scorer that does not report the SCORE_PARAMETERS capability, are
            silently ignored. Values must be scalars (string, number, or boolean);
            requests with array or object values are rejected with 400.
          additionalProperties: true
    ScoreResponse:
      type: object
      properties:
        id:
          type: string
          description: |
            Identifies the specific model version that produced this response. Under
            traffic-split (A/B, canary, champion/challenger) or updated-in-place
            deployments this may differ between requests to the same endpoint; use this
            value, not a follow-up `GET /model/id` call, to attribute a specific response
            to a model version.
        fields:
          type: array
          description: |
            An array holding the names of fields in the order of appearance in the rows of the  `score` property. This field is not populated if requested by setting the `noFieldNamesInOutput` request field to `true`.
          items:
            type: string
        score:
          type: array
          description: |
            An array of rows consisting the actual scoring output. The order of rows corresponds to the order of the input request rows. Each row contains any copied input fields first (in the order of appearance in the input row). If the `idField` was specified and also listed in the `includeFieldsInOutput` but not provided in `fields`, a unique id will be generated and positioned right after all the other fields copied from the input. The scoring output follows.

            The row shape mirrors the request: a columnar request (`fields`/`rows`)
            yields string-valued `Row` arrays; a records request yields `ScoreRecord`
            objects with native JSON values and no accompanying `fields` array.
          items:
            oneOf:
              - $ref: '#/components/schemas/Row'
              - $ref: '#/components/schemas/ScoreRecord'
        rowIds:
          type: array
          description: |
            Row ids, one per row of `score`, in the same order. Present when `idField` was
            set in the request, regardless of `includeFieldsInOutput`: `idField` is
            resolved per the shared field-naming contract (see `idField`): resolved
            values are echoed (non-string scalars are stringified; a null or unresolved
            id is echoed as null); a name that matches nothing yields a generated UUID
            per row. Use `rowIds` for row-level correlation and the `X-Request-ID`
            response header for request-level correlation.
          items:
            type: string
            nullable: true
        featureShapleyContributions:
          $ref: '#/components/schemas/ContributionResponse'
        predictionIntervals:
          $ref: '#/components/schemas/PredictionInterval'
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: |
            A string message containing the detail error message.
    DataField:
      type: object
      properties:
        name:
          type: string
        dataType:
          $ref: '#/components/schemas/DataType'
        typeSpec:
          $ref: '#/components/schemas/TypeSpec'
        media:
          type: string
          description: >-
            Media kind of this input field, present only when the model
            declares media input fields. Open vocabulary; known values:
            image, audio, video, binary (consumers treat unknown values as
            binary). Media fields accept inline base64 payloads at
            POST /model/score, or file uploads referenced by filename at
            POST /model/media-score.
          example: image
        example:
          type: string
    DataType:
      type: string
      enum:
        - Bool
        - Int32
        - Int64
        - Float32
        - Float64
        - Str
        - Time64
        - Bytes
        - Array
        - Object
    TypeSpec:
      type: object
      description: |
        Structured descriptor of a composite (Array/Object) field's inner
        structure. Present only when the owning dataType is Array or Object
        AND the runtime knows the interior; absent on a composite field means
        the interior is unknown and clients degrade to dataType-only handling.
        Exactly the properties matching the owning dataType are set:
        Array -> items; Object -> fields (declared, ordered properties)
        and/or values (dynamic string-keyed entries, i.e. a map). All
        runtimes emit this same format; clients MAY parse it. Clients MUST
        ignore unrecognized properties, and MUST treat a typeSpec containing
        only unrecognized properties as unknown interior. Producers and
        consumers cap nesting depth at 32.
      properties:
        items:
          $ref: '#/components/schemas/NestedType'
        fields:
          type: array
          items:
            $ref: '#/components/schemas/NestedField'
        values:
          $ref: '#/components/schemas/NestedType'
    NestedType:
      type: object
      description: |
        A type inside a composite. Same contract as DataField: a dataType
        plus an optional typeSpec present only for Array/Object with a known
        interior.
      required:
        - dataType
      properties:
        dataType:
          $ref: '#/components/schemas/DataType'
        typeSpec:
          $ref: '#/components/schemas/TypeSpec'
    NestedField:
      type: object
      description: A named, declared property of an Object composite.
      required:
        - name
        - dataType
      properties:
        name:
          type: string
        dataType:
          $ref: '#/components/schemas/DataType'
        typeSpec:
          $ref: '#/components/schemas/TypeSpec'
    ModelSchema:
      type: object
      properties:
        inputFields:
          type: array
          items:
            $ref: '#/components/schemas/DataField'
        targetFields:
          type: array
          items:
            $ref: '#/components/schemas/DataField'
        outputFields:
          type: array
          items:
            $ref: '#/components/schemas/DataField'
    ShapleyType:
      type: string
      enum:
        - ORIGINAL
        - TRANSFORMED
        - NONE
    ScoringType:
      type: string
      enum:
        - REGRESSION
        - CLASSIFICATION
        - BINOMIAL
    CapabilityType:
      type: string
      description: |
        Capability type reported by the scorer. Only capabilities the model and its runtime actually support are returned.

        - `SCORE` — standard row scoring via POST /model/score
        - `SCORE_PREDICTION_INTERVAL` — prediction intervals supported in scoring responses
        - `CONTRIBUTION_ORIGINAL` — Shapley contributions in original feature space via POST /model/contribution
        - `CONTRIBUTION_TRANSFORMED` — Shapley contributions in transformed feature space via POST /model/contribution
        - `MEDIA` — media file scoring via POST /model/media-score
        - `RECORDS` — records-format requests (`{"records": [...]}`) accepted at POST /model/score (and POST /model/media-score on media-capable runtimes). A runtime capability, independent of the model: emitted by runtimes whose scoring stack parses records.
        - `RECORDS_ONLY` — the model's input or output schema declares composite (Array/Object) fields; only records-format requests are accepted at POST /model/score, and columnar (`fields`/`rows`) requests are rejected with 400. Absent when the model's schema is flat, in which case columnar requests are accepted.
        - `SCORE_PARAMETERS` — the scorer honors the optional `parameters` field on score/contribution requests
      enum:
        - SCORE
        - SCORE_PREDICTION_INTERVAL
        - CONTRIBUTION_ORIGINAL
        - CONTRIBUTION_TRANSFORMED
        - MEDIA
        - RECORDS
        - RECORDS_ONLY
        - SCORE_PARAMETERS
    Model_properties:
      type: object
      properties:
        scoringType:
          $ref: '#/components/schemas/ScoringType'
        scoringResponseLabels:
          type: array
          description: |
            Class labels of a classification model, in the same order as the per-class
            probability output columns, so consumers can zip labels against probabilities.
            Populated only for classification models (scoringType CLASSIFICATION or BINOMIAL);
            omitted otherwise.
          items:
            type: string
    PredictionInterval:
      type: object
      description: >-
        Prediction interval consist of an array of interval bound names
        and rows of array of bounds per bound name. Setting `requestPredictionIntervals`
        to true will enable populating the field. The field will be empty or an error
        response returned if prediction intervals are not returned or supported by the model.
        The same bound columns are always present in `score` as well (appended after the
        prediction columns), so this field is a structured view, not the only place they appear.
      properties:
        fields:
          type: array
          items:
            type: string
        rows:
          type: array
          items:
            $ref: '#/components/schemas/Row'
    scoreMediaRequest:
      allOf:
        - $ref: '#/components/schemas/ScoreRequest'
        - properties:
            mediaFields:
              description: >
                An array holding the names of all fields which are expected to contain media files.
                Contents of these fields will be replaced by corresponding uploaded files where the
                expected values in the column must be the file names of the uploaded files.
                May be omitted: when absent or empty, the model's schema-declared media columns
                are used instead. It is only required for a media-capable model that declares no
                media fields, which otherwise fails with 400.
              type: array
              items:
                type: string
