Predictions endpoints
POST /v1/predict
Record a falsifiable prediction. See predict.
curl -X POST https://mneva.dev/v1/predict \
-H "x-mneva-key: $MNEVA_KEY" \
-H "content-type: application/json" \
-d '{
"prediction": "the migration will need a hotfix",
"domain": "schema",
"confidence": 0.4,
"basis": "v2 backfill is doing two passes"
}'
| Field | Type | Required | Default |
|---|---|---|---|
prediction | string | yes | — |
domain | string | yes | — |
confidence | number 0..1 | no | 0.5 |
basis | string | no | null |
Response:
{ "id": 2, "domain": "schema", "confidence": 0.4 }
POST /v1/resolve
Close out a prediction with what happened. See resolve.
curl -X POST https://mneva.dev/v1/resolve \
-H "x-mneva-key: $MNEVA_KEY" \
-H "content-type: application/json" \
-d '{
"prediction_id": 2,
"outcome": "correct",
"actual": "needed to add a default value"
}'
| Field | Type | Required | Default |
|---|---|---|---|
prediction_id | int | yes | — |
outcome | correct | incorrect | partial | yes | — |
actual | string | yes | — |
surprise | number 0..1 | no | derived |
Response:
{ "prediction_id": 2, "outcome": "correct", "surprise": 0.6 }
Errors: 404 prediction X not found, prediction X belongs to another project, prediction X is already resolved, outcome must be one of: correct, incorrect, partial.
GET /v1/predictions/open
List unresolved predictions, oldest first. See predictions_open.
curl "https://mneva.dev/v1/predictions/open?limit=20" -H "x-mneva-key: $MNEVA_KEY"
| Query param | Type | Default |
|---|---|---|
limit | int 1..50 | 20 |
Response:
{
"predictions": [
{ "id": 2, "prediction": "...", "domain": "...", "confidence": 0.4, "basis": null, "created_at": "..." }
]
}
GET /v1/calibration
Per-domain track record. See calibration.
curl "https://mneva.dev/v1/calibration?since_days=30" -H "x-mneva-key: $MNEVA_KEY"
| Query param | Type | Default |
|---|---|---|
since_days | int >= 1 | null (all-time) |
Response shape (see calibration for the full example):
{
"total_resolved": 12,
"window_days": null,
"domains": [
{
"domain": "schema",
"n": 7,
"accuracy": 0.86,
"correct": 6,
"incorrect": 1,
"partial": 0,
"mean_confidence_when_correct": 0.62,
"mean_confidence_when_incorrect": 0.40,
"confidence_gap": 0.22,
"mean_surprise": 0.18
}
]
}
Domains are sorted by n descending.