Developer API

Send a decision and its input features. Get back a decision record, feature importance, confidence and explanations in English, Hindi and Marathi.

Authentication

Bearer token with scoped permissions and 60 requests/minute rate limiting

Pass your key as Authorization: Bearer <key>. Keys are hashed at rest, can be rotated or revoked instantly, and every request is written to API usage and the audit trail.

POST /api/public/v1/explain

Analyze a decision and store an audit-ready explanation

curl -X POST https://your-app.lovable.app/api/public/v1/explain \
  -H "Authorization: Bearer xai_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "loan-risk-v2",
    "features": {
      "credit_score": 620,
      "annual_income": 600000,
      "debt_ratio": 0.48,
      "employment_years": 3,
      "existing_loans": 2
    }
  }'

Other endpoints

Read-only access for downstream systems

  • GET /api/public/v1/decisions — list recent decisions (requires decisions:read)
  • GET /api/public/v1/decisions/:id — full record with explanation
  • GET /api/public/v1/models — available models and metrics