Skip to main content

Test Model

Page Outline

Runs a single synchronous test prediction against the promoted model version using caller-supplied input data, returning the prediction result and inference metadata.

Base Path: /api/v1/models

Method: POST

Path: /{model_id}/test

Auth: Requires a valid Bearer token (Authorization: Bearer <JWT>)

Path Parameters

ParameterTypeDescription
model_idstringUnique identifier of the model

Request Body

{
"inputs": {
"age": 34,
"tenure": 2,
"monthly_spend": 89.99,
"support_tickets": 0
},
"version_id": "ver-001"
}
FieldTypeRequiredDescription
inputsobjectKey-value map of feature names to input values. Must match the model's configured feature_columns
version_idstringSpecific version to test. Defaults to the currently promoted version

Behavior

  • Performs a synchronous inference call — the response is returned inline (no async polling required).
  • Inputs are validated against the model's schema before inference. Returns HTTP 422 if required features are missing or types are incompatible.
  • Test predictions are not counted toward monitoring inference statistics and do not affect drift tracking.
  • Test predictions are only available for models in ready status with a promoted version; returns HTTP 409 for draft or training models.
  • Returns HTTP 422 if the model has no promoted version yet.

Response

Returns a TestPrediction object.

{
"model_id": "mdl-7f3a19bc",
"version_id": "ver-001",
"inputs": {
"age": 34,
"tenure": 2,
"monthly_spend": 89.99,
"support_tickets": 0
},
"prediction": "churned",
"probabilities": {
"not_churned": 0.13,
"churned": 0.87
},
"latency_ms": 14.2,
"predicted_at": "2026-03-13T16:10:05Z"
}