> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a prediction

> Get a prediction from the specified model.



## OpenAPI

````yaml /api-reference/5.9/fusion-api-ml-model-service.json post /ai/ml-models/{modelId}/prediction
openapi: 3.0.1
info:
  title: Machine Learning Model Service API
  description: >-
    Use these APIs to deploy machine learning (ML) models and generate
    predictions. Fusion's Machine Learning (ML) Model service stores deployed
    models and runs prediction jobs.
  version: '5.9'
  contact:
    name: Lucidworks Support
    url: https://lucidworks.com/support/
servers:
  - url: https://{FUSION HOST}/api
    description: Fusion
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
  - url: https://{FUSION HOST}/api/apps/{APP_NAME}
    description: Fusion app
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
      APP_NAME:
        default: APP_NAME
        description: The name of your Fusion application.
security: []
tags:
  - name: Model Service API
    description: Use this API to deploy ML models and generate predictions.
  - name: Serialized Model API
    description: >-
      The Serialized Model API is for fetching, updating, or deleting deployed
      models.
paths:
  /ai/ml-models/{modelId}/prediction:
    post:
      tags:
        - Model Service API
      summary: Get a prediction
      description: Get a prediction from the specified model.
      operationId: predict
      parameters:
        - name: modelId
          in: path
          required: true
          schema:
            type: string
          example: sentiment-reviews
      requestBody:
        content:
          application/json:
            schema:
              type: object
            example:
              text: Hello world.  How are you doing today?
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              example:
                score:
                  - '0.8543054461479187'
                label:
                  - positive
                _rawJsonResponse: |-
                  {
                    "names": ["label", "score", "tokens", "attention_weights"],
                    "ndarray": [["positive"], ["0.8543054461479187"]]
                  }
        '500':
          description: >-
            Either the model is not properly deployed, the model ID is wrong, or
            the input fields are wrong.

````