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"
  }'
FieldTypeRequiredDefault
predictionstringyes
domainstringyes
confidencenumber 0..1no0.5
basisstringnonull

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"
  }'
FieldTypeRequiredDefault
prediction_idintyes
outcomecorrect | incorrect | partialyes
actualstringyes
surprisenumber 0..1noderived

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 paramTypeDefault
limitint 1..5020

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 paramTypeDefault
since_daysint >= 1null (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.

Was this page helpful?