API reference

API & SDKs

Reality Signal is an API for decision systems. You send a model score (or feature payload) and receive a calibrated probability (prob_est), an uncertainty estimate, and a boolean decision flag computed against your configured threshold.

Authentication

Include your key in the x-api-key header.

text
All requests require an API key header:

x-api-key: YOUR_API_KEY

Base URL

Your deployment’s base URL. In this environment:
https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io

Quickstart (Python)

Minimal integration: call /decide, store decision_id, then close the loop with /feedback.

python
import requests

API_URL = "https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io"
HEADERS = {"x-api-key": "YOUR_API_KEY"}

# Score-based payload (quick integration)
payload = {"features": {"score": 0.82}}

res = requests.post(f"{API_URL}/decide", json=payload, headers=HEADERS)
res.raise_for_status()
data = res.json()

decision_id = data["decision_id"]
prob_est = data["prob_est"]
uncertainty = data["uncertainty"]
decision = data["decision"]

print(decision_id, prob_est, uncertainty, decision)

# Later, once ground truth is known:
feedback = {"decision_id": decision_id, "feedback": 1, "force_retrain": False}
requests.post(f"{API_URL}/feedback", json=feedback, headers=HEADERS).raise_for_status()

POST /decide

Request body
featuresrequired
A feature dictionary. For quick integration, include { score: number }. For expert use, include richer features.
object
Examples
Score-based
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/decide   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "features": { "score": 0.82 }
  }'
Feature-based
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/decide   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "features": {
      "user_region": "North",
      "request_value": 4500,
      "historical_count": 12
    }
  }'
Response
decision_idrequired
Identifier used to send feedback later.
number
prob_estrequired
Calibrated probability estimate.
number
uncertaintyrequired
Uncertainty estimate (higher means less certain).
number
decisionrequired
Decision flag computed from prob_est against your configured threshold.
boolean
json
{
  "decision_id": 123,
  "prob_est": 0.62,
  "uncertainty": 0.08,
  "decision": false
}

POST /feedback

Send ground truth back to Reality Signal. This powers drift detection and continuous calibration improvements.

Request body
decision_idrequired
The decision_id returned from /decide.
number
feedbackrequired
Ground truth outcome: 1 for positive/correct, 0 for negative/incorrect.
0 | 1
force_retrainoptional
If true, triggers immediate model update.
boolean
Example
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/feedback   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "decision_id": 123,
    "feedback": 1,
    "force_retrain": false
  }'

POST /configure

Configure decision thresholds and economics. You can set a probability threshold for the decision flag, plus uncertainty guardrails and cost/loss parameters.

Request body
thresholdoptional
Probability cutoff for a "True" decision. Default: 0.5.
number
uncertainty_thresholdoptional
Limit where a prediction is considered "too uncertain". Default: 0.05.
number
costoptional
Benefit of a successful True decision. Default: 10.0.
number
lossoptional
Penalty of a True decision that fails. Default: 100.0.
number
feedback_fractionoptional
Percent of decisions sampled for feedback. Default: 0.1 (10%).
number
Example
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/configure   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "threshold": 0.70,
    "uncertainty_threshold": 0.05,
    "cost": 15.0,
    "loss": 200.0,
    "feedback_fraction": 0.05
  }'

Operations endpoints

POST /recalibrate

Force the system to update based on the entire historical dataset immediately.

POST /reset

Permanently deletes historical data and resets configuration to defaults. Use with caution.

GET /health

Verify service and database connectivity.

Errors

The API returns standard HTTP status codes. If a request fails, inspect the response body for details.
  • • 400: invalid request / missing fields
  • • 401 / 403: missing or invalid x-api-key
  • • 500: server error
Tip: If you’re calling from the browser, use the Docs “Try it now (live)” proxy to avoid CORS issues.