---
title: "Get Predictions"
method: GET
path: "/metrics/predictions"
---

# Get Predictions

`GET /metrics/predictions`

Evaluate all predictive forecasts and return active alerts.

Checks three forecast dimensions:

- **Budget exhaustion**: At current spend velocity, when will the
  budget cap be reached?
- **Completion rate decline**: Is the task completion rate trending
  downward, indicating the run will take longer than expected?
- **Run duration overrun**: Based on current throughput, will the run
  exceed the configured time window?

Use ``budget_cap`` to enable the budget forecast. The run duration
forecast requires at least one completed task.

Both numeric parameters are echoed back in the response body, so both
refuse non-finite values with a 422 instead of admitting them: a range
bound alone does not exclude them (``inf >= 0.0`` is true, and every
comparison against ``NaN`` is false), and the JSON renderer cannot
serialise either one.

The budget forecast is scoped to ``tenant_id``: the spend series it is
built from is narrowed to cost points recorded for the caller's tenant,
the same way the rest of the cost surface is (see
``load_cost_history``).  Cost points written before per-tenant
attribution existed are treated as the default tenant's spend, so a
legacy single-tenant install keeps its existing numbers.

Returns a list of ``alerts`` ordered by severity (critical first).
Each alert has: ``kind``, ``severity``, ``message``,
``minutes_until_impact``, ``confidence``.

## Query parameters

- `budget_cap` number — Budget ceiling in USD (0 = skip budget forecast)
- `window_hours` number — Configured run window in hours (default 4)

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/revisions/c731d9228f03/schema)
