Predict.aiDocs
Inference

Run a forecast

Get predictions out of a deployed model — by goal, pipeline, or pinned deployment.

The fastest path: point segment inference at a goal. The platform prepares model input from live data, and the URL keeps working through champion swaps and promotions.

curl -X POST "$API_BASE/v1/inference/goals/$GOAL_ID/infer-segment" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "predictions": [
    {
      "label": "daily_sales",
      "point": [1250.75, 1274.1, 1268.3, ]
    }
  ],
  "horizon": 14,
  "labels": ["daily_sales"],
  "forecast_horizon": 14,
  "model_id": "9f2c41d8-…",
  "deployment_id": "c4a7…",
  "deployment_type": "shared",
  "segment_id": "SEGMENT_ID",
  "segment_name": "Retail daily",
  "training_id": "7d81c3f0-…",
  "sequence_length": 15,
  "feature_names": ["website_visitors", "marketing_spend", ],
  "inference_id": "b7e6…",
  "latency_ms": 245.67,
  "timestamp": "2026-07-15T12:04:45.123000+00:00Z",
  "data_period": {
    "start": "2026-06-30T00:00:00Z",
    "end": "2026-07-14T00:00:00Z"
  }
}

The body is optional — an empty {} is a complete request, because the platform derives everything from the deployment behind the goal. The body options (quantiles, horizon overrides for foundation deployments, feature debug) work here too.

Response fields

Responses are top-level payloads — there is no {"data": …} wrapper on inference routes.

FieldMeaning
predictionsAlways an array of { label, point } entries — one per output label, point spanning the horizon — with optional quantiles for probabilistic forecasts.
horizon / labelsHow many steps were predicted, for which segment labels.
deployment_id / deployment_typeWhich concrete deployment actually served the request.
model_id / training_idThe pipeline and the training behind the serving model.
sequence_length / feature_namesThe input shape: timesteps of history and the features prepared, in input order.
data_periodThe window of live data the input was built from.
inference_idThe request's ID — appears in history and realtime events.
latency_msEnd-to-end serving latency.

Pipeline alias

Same request against the pipeline you own — resolves to its current champion's deployment, survives promotions:

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

Version-pinned deployment, raw tensor

To pin an exact version — or to send your own model input — call the deployment directly with raw /infer:

FieldMeaning
input requiredA flat vector or a batch of vectors, in the exact feature order the model was trained on.
parameters optionalServing parameters passed through to the model server.
curl -X POST "$API_BASE/v1/inference/deployments/$DEPLOYMENT_ID/infer" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "input": [[0.42, 0.13, 0.77, 0.91, 0.05, …]],
    "parameters": {}
  }'
{
  "predictions": [
    { "label": "output", "point": [0.8734, 0.8812, ] }
  ],
  "horizon": 14,
  "labels": ["output"],
  "model_id": "9f2c41d8-…",
  "training_id": "7d81c3f0-…",
  "deployment_id": "c4a7…",
  "deployment_type": "shared",
  "inference_id": "b7e6…",
  "latency_ms": 189.42,
  "timestamp": "2026-07-15T12:04:45.123000+00:00Z",
  "usage": {
    "input_tokens": 142,
    "output_tokens": 96
  }
}

Raw inference has no segment labels to map to, so predictions come back under the synthetic output label — map them by index. Values are the model's direct output; segment inference is what applies inverse scaling and label mapping for you. Raw /infer is also available on the pipeline and goal aliases.

If you get a 202

Segment inference on a foundation deployment returns 202 Accepted when the model server was cold:

{
  "async": true,
  "status": "pending",
  "inference_id": "b7e6…",
  "deployment_id": "c4a7…",
  "segment_id": "SEGMENT_ID",
  "message": "Inference started. The model server may be cold; this can take a few minutes."
}

Subscribe to the workspace's realtime channel for the inference.completed event, or poll GET /v1/inference/{inference_id} until the record appears. See Concepts.

What it costs

Inference on Shared serving is metered in credits per request (rate depends on the model kind); Dedicated serving includes inference in its flat daily hosting fee. A request that fails to produce a forecast is refunded automatically. Rates live in Billing.

Errors

All inference errors use the coded envelope:

{
  "error": {
    "code": "DEPLOYMENT_NOT_FOUND",
    "message": "Deployment c4a7… not found or not ready",
    "details": {  }
  }
}
StatusCodeWhy
400INVALID_FORMATRaw infer: body isn't JSON
400MISSING_INPUTRaw infer: no input field
400VALIDATION_ERRORSegment infer on a foundation deployment without segment_id
400CONFIGURATION_ERRORThe deployment's model/segment configuration can't be resolved
401UNAUTHORIZEDToken missing or invalid
403FORBIDDENYou don't have access to this deployment
404DEPLOYMENT_NOT_FOUNDDeployment doesn't exist or isn't ready
404MODEL_NOT_DEPLOYEDPipeline/goal alias has no active deployment — deploy a trained model first
4xx/5xxINFERENCE_FAILEDThe serving path failed; status mirrors the upstream failure
500DATA_PREPARATION_ERROR, INPUT_PREPARATION_ERRORSegment infer: live data couldn't be fetched or shaped
500INTERNAL_ERRORUnexpected server error

INFERENCE_FAILED errors carry a retryable flag — true means the failure looks transient (for example, the model server was cold or restarting) and an immediate retry is likely to succeed.

On this page