API Reference

Complete API endpoint documentation

Base URL

https://api.senraio.com

Authentication

Use a Bearer token (your API key) in the Authorization header, or X-API-Key.

Authorization: Bearer sk_live_your_api_key_here

Endpoints

  • GET /api/v1/predict/{bill_id} — Get all predictions for a bill (Royal Assent and risk models). When (schedule) from Parliament.
  • POST /api/v1/predictions/batch — Predictions for multiple bills (up to 100 per request). POST /api/v1/predict/batch is also supported as an alias.
  • POST /api/v1/alerts/thresholds — Create predictive alert thresholds (Pilot+).

Responses include risk predictions: stall_risk, amendment_risk, close_vote (experimental — rough indicator only), withdrawal_risk, plus risk_indicators (controversy_score, momentum_score, levels).

Error handling

CodeDescription
200Success
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate limit exceeded
503Service Unavailable (models loading)

Rate limits

TierAPI calls/dayBatch/day
Free00
Pilot1,00010
ProUnlimited100