Predict.aiDocs
Inference

Segment-based inference

Let the platform prepare model input from live segment data — options, async behavior, and when to go raw.

/infer-segment is the production path: instead of building an input tensor yourself, the platform rebuilds the exact input the model saw during training, from the segment's live data, on every request.

curl -X POST "$API_BASE/v1/inference/deployments/$DEPLOYMENT_ID/infer-segment" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{}'

The same route exists on the pipeline and goal aliases.

What the platform prepares

For a deployment backed by a trained model, each request:

  1. Looks up the model's configuration — segment, sequence length, feature set.
  2. Fetches the segment's most recent live data.
  3. Applies the normalization and engineered features used during training.
  4. Assembles the input in the exact shape the model was trained on.
  5. Runs inference, inverse-scales the outputs back to real units, and maps them to segment labels.

That's why an empty body {} is a complete request — everything the model needs is derived from the deployment. The response's data_period tells you the window of data it used, and feature_names the features that went in.

Body options

For trained-model deployments the body is optional. One debugging knob is supported:

FieldMeaning
parameters.feature_debug optionaltrue returns the prepared feature vector, feature order, and sequence shape in a debug block.

Foundation deployments (a foundation model deployed zero-shot, with no trained model attached) have no bound segment, so you tell them what to forecast:

FieldMeaning
segment_id requiredThe segment to forecast.
horizon optionalForecast steps ahead. Defaults to the deployment's horizon.
samples optionalSample paths for probabilistic forecasts. Defaults to 100.
quantile_levels optionalQuantiles to return. Defaults to [0.1, 0.5, 0.9].
context_length optionalHistory window the model conditions on. Defaults to the model's own.
curl -X POST "$API_BASE/v1/inference/deployments/$DEPLOYMENT_ID/infer-segment" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "segment_id": "SEGMENT_ID",
    "horizon": 28,
    "quantile_levels": [0.1, 0.5, 0.9]
  }'

Omitting segment_id on a foundation deployment returns 400 VALIDATION_ERROR.

Foundation deployments answer 202 Accepted when the model server was cold, and complete asynchronously — see handling a 202. Trained-model deployments always respond synchronously.

Reading the response

The full shape is shown in Run a forecast. The segment-specific fields:

FieldMeaning
predictions[].labelSegment label the forecast belongs to
predictions[].quantilesQuantile forecasts keyed by level (e.g. "0.1", "0.5", "0.9"), when requested
segment_id, segment_nameThe segment that fed the model
sequence_lengthTimesteps of history in the model input
feature_namesFeatures prepared, in input order
data_periodStart/end of the live data window used
shockPresent only when the goal behind this deployment is in shock/recovery and the forecast was blended accordingly
debugPresent only with feature_debug: true

When to prefer raw /infer

Reach for raw inference when segment preparation gets in the way:

  • You compute features in your own system and want the model to see exactly those values — not the segment's live data.
  • You're backtesting or replaying historical inputs.
  • You're integrating an existing client that already speaks a standard {"input": …} tensor format.

You take on preprocessing yourself: raw inputs must match the training feature order, and outputs come back unscaled under the synthetic output label. See Run a forecast.

On this page