Prerequisites
Before you begin, you’ll need:
- A free API key (get one instantly - click “Get API Key”)
- Python 3.8+, Node.js 18+, or Java 17+
Test keys (rv_test_*) are free and include 100 requests/day. No credit card required.
Installation
Install the Rotavision SDK for your preferred language:
Initialize the Client
from rotavision import Rotavision
client = Rotavision(api_key="rv_live_...")
# Or use environment variable ROTAVISION_API_KEY
client = Rotavision()
Your First API Call
Let’s analyze a model prediction for fairness using Vishwas:
# Analyze fairness of a loan approval model
result = client.vishwas.analyze(
model_id="loan-approval-v2",
dataset={
"features": ["age", "income", "credit_score", "gender", "location"],
"predictions": predictions,
"actuals": actuals,
"protected_attributes": ["gender", "location"]
},
metrics=["demographic_parity", "equalized_odds", "calibration"]
)
print(f"Fairness Score: {result.overall_score}")
print(f"Bias Detected: {result.bias_detected}")
for metric in result.metrics:
print(f" {metric.name}: {metric.value:.3f} ({metric.status})")
Example Response
{
"id": "analysis_abc123",
"model_id": "loan-approval-v2",
"overall_score": 0.82,
"bias_detected": true,
"metrics": [
{
"name": "demographic_parity",
"value": 0.78,
"threshold": 0.80,
"status": "warning",
"affected_groups": ["location:rural"]
},
{
"name": "equalized_odds",
"value": 0.91,
"threshold": 0.80,
"status": "pass"
},
{
"name": "calibration",
"value": 0.85,
"threshold": 0.80,
"status": "pass"
}
],
"recommendations": [
{
"severity": "medium",
"message": "Rural applicants have 22% lower approval rate despite similar creditworthiness",
"action": "Review feature weights for location-correlated variables"
}
],
"created_at": "2026-02-01T10:30:00Z"
}
Next Steps