---
title: "Batch ML Predictions"
method: POST
path: "/v1/predict"
tags: ["AI"]
---

# Batch ML Predictions

`POST /v1/predict`

Perform a batch of ML predictions, using multiple models, in one request. This is useful for ensembling or A/B testing different models.

## Request body

- BatchPredictRequest
  - `predictions` PredictRequest[] — The list of prediction requests, each specifying the model to use for the prediction
    - `model_name` string, required

## Response `200`

Batch predictions completed successfully

- BatchPredictResponse
  - `duration_ms` integer, required
  - `predictions` PredictResponse[], required
    - `duration_ms` integer, required — The time taken to complete the prediction (in milliseconds)
    - `error_message` string, nullable — The error message if the request failed
    - `model_name` string, required — The name of the model used for the prediction
    - `model_version` string, nullable — The version of the model used
    - `prediction` number[], nullable — The prediction result, typically an array of floats
    - `status` 'Success' | 'BadRequest' | 'InternalError', required

## Other responses

- `500` — Internal server error occurred during batch prediction

## Changes

- **2025-03-18** `dd94571fef79` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/spiceai/apis/runtime/changes/v1/predict/post.md)

---

[API](https://skmtc.dev/spiceai/apis/runtime.md) · [All operations](https://skmtc.dev/spiceai/apis/runtime/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spiceai/runtime/revisions/dd94571fef79/schema)
