Skip to main content
POST
https://api.rotavision.com
/
vishwas
/
explain
curl -X POST https://api.rotavision.com/v1/vishwas/explain \
  -H "Authorization: Bearer rv_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "loan-approval-v2",
    "input_data": {
      "age": 32,
      "income": 850000,
      "credit_score": 720,
      "employment_years": 5,
      "existing_loans": 1,
      "region": "urban"
    },
    "prediction": 0.73,
    "method": "shap",
    "num_features": 5,
    "language": "en",
    "audience": "customer"
  }'
{
  "id": "explain_xyz789",
  "model_id": "loan-approval-v2",
  "method": "shap",
  "prediction": {
    "value": 0.73,
    "label": "likely_approved",
    "confidence": "medium-high"
  },
  "features": [
    {
      "name": "credit_score",
      "value": 720,
      "contribution": 0.18,
      "direction": "positive",
      "description": "Your credit score of 720 is above average, increasing approval likelihood"
    },
    {
      "name": "income",
      "value": 850000,
      "contribution": 0.15,
      "direction": "positive",
      "description": "Your annual income supports the requested loan amount"
    },
    {
      "name": "employment_years",
      "value": 5,
      "contribution": 0.08,
      "direction": "positive",
      "description": "5 years of stable employment is viewed favorably"
    },
    {
      "name": "existing_loans",
      "value": 1,
      "contribution": -0.05,
      "direction": "negative",
      "description": "Having an existing loan slightly reduces approval likelihood"
    },
    {
      "name": "age",
      "value": 32,
      "contribution": 0.02,
      "direction": "positive",
      "description": "Your age falls within a favorable range for this loan type"
    }
  ],
  "summary": "Your loan application has a 73% likelihood of approval. The main factors supporting your application are your good credit score (720) and stable income (₹8.5 lakhs annually). Your 5 years of employment history also strengthens your application. The only factor slightly reducing your score is your existing loan, but this is minor compared to the positive factors.",
  "baseline": 0.35,
  "created_at": "2026-02-01T10:30:00Z"
}

Request

model_id
string
required
Unique identifier for your model.
input_data
object
required
The input features for the prediction to explain.
prediction
number | string
required
The model’s prediction (probability or class label).
method
string
default:"shap"
Explanation method to use:
  • shap - SHAP values (recommended)
  • lime - LIME explanations
  • anchors - Rule-based anchors
  • counterfactual - Counterfactual examples
  • prototype - Similar training examples
num_features
integer
default:"10"
Number of top features to include in explanation.
language
string
default:"en"
Language for human-readable text. Supports: en, hi, ta, te, bn, mr, gu, kn, ml, pa, or, as.
audience
string
default:"technical"
Target audience for explanation:
  • technical - For data scientists and ML engineers
  • business - For business stakeholders
  • customer - For end users/customers

Response

id
string
Unique explanation identifier.
model_id
string
The model ID.
method
string
The explanation method used.
prediction
object
The prediction being explained.
features
array
Feature contributions ranked by importance.
summary
string
Human-readable explanation text.
counterfactuals
array
Counterfactual examples (if method is counterfactual).
curl -X POST https://api.rotavision.com/v1/vishwas/explain \
  -H "Authorization: Bearer rv_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "loan-approval-v2",
    "input_data": {
      "age": 32,
      "income": 850000,
      "credit_score": 720,
      "employment_years": 5,
      "existing_loans": 1,
      "region": "urban"
    },
    "prediction": 0.73,
    "method": "shap",
    "num_features": 5,
    "language": "en",
    "audience": "customer"
  }'
{
  "id": "explain_xyz789",
  "model_id": "loan-approval-v2",
  "method": "shap",
  "prediction": {
    "value": 0.73,
    "label": "likely_approved",
    "confidence": "medium-high"
  },
  "features": [
    {
      "name": "credit_score",
      "value": 720,
      "contribution": 0.18,
      "direction": "positive",
      "description": "Your credit score of 720 is above average, increasing approval likelihood"
    },
    {
      "name": "income",
      "value": 850000,
      "contribution": 0.15,
      "direction": "positive",
      "description": "Your annual income supports the requested loan amount"
    },
    {
      "name": "employment_years",
      "value": 5,
      "contribution": 0.08,
      "direction": "positive",
      "description": "5 years of stable employment is viewed favorably"
    },
    {
      "name": "existing_loans",
      "value": 1,
      "contribution": -0.05,
      "direction": "negative",
      "description": "Having an existing loan slightly reduces approval likelihood"
    },
    {
      "name": "age",
      "value": 32,
      "contribution": 0.02,
      "direction": "positive",
      "description": "Your age falls within a favorable range for this loan type"
    }
  ],
  "summary": "Your loan application has a 73% likelihood of approval. The main factors supporting your application are your good credit score (720) and stable income (₹8.5 lakhs annually). Your 5 years of employment history also strengthens your application. The only factor slightly reducing your score is your existing loan, but this is minor compared to the positive factors.",
  "baseline": 0.35,
  "created_at": "2026-02-01T10:30:00Z"
}