--- title: Bank Fraud Detection API emoji: 🏦 colorFrom: red colorTo: yellow sdk: docker pinned: false --- # 🏦 Bank Fraud Detection API A FastAPI-based fraud detection API powered by `austinb/fraud_text_detection` (DistilBERT). ## Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/health` | Health check | | POST | `/predict` | Single fraud risk score + risk level | | POST | `/predict/batch` | Batch predictions | | POST | `/analyze` | Full analysis — score + risk + binary detection | ## Example Usage ```bash curl -X POST https://YOUR-SPACE-URL/analyze \ -H "Content-Type: application/json" \ -d '{"text": "User transferred 50000 to an unknown account at midnight"}' ``` ## Response ```json { "text": "User transferred 50000 to an unknown account at midnight", "fraud_score": 0.923, "risk_level": "High Risk 🚨", "is_fraud": true, "detection": "Fraud Detected 🚨" } ```