REST API Reference¶
All services expose FastAPI with automatic Swagger UI at /docs, Prometheus metrics at /metrics, and health checks at /health.
| BankChurn Swagger | NLPInsight Swagger | ChicagoTaxi Swagger |
|---|---|---|
![]() |
![]() |
![]() |
Endpoints¶
BankChurn (:8001)¶
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /predict |
Churn prediction (add ?explain=true for SHAP contributions) |
| GET | /metrics |
Prometheus metrics |
| GET | /docs |
Swagger UI |
Predict Request:
{"CreditScore":650,"Geography":"France","Gender":"Male","Age":40,"Tenure":5,"Balance":60000,"NumOfProducts":2,"HasCrCard":1,"IsActiveMember":1,"EstimatedSalary":50000}
Response:
NLPInsight (:8003)¶
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /predict |
Sentiment analysis |
| GET | /metrics |
Prometheus metrics |
| GET | /docs |
Swagger UI |
Predict Request:
Response:
ChicagoTaxi (:8004)¶
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /demand |
Query demand predictions by area/hour |
| GET | /areas |
List all areas ranked by demand |
| GET | /pipeline/status |
ETL pipeline metadata |
| GET | /metrics |
Prometheus metrics |
| GET | /docs |
Swagger UI |
Demand Request:
Response:
Live Predictions¶
| BankChurn (with SHAP) | NLPInsight (Sentiment) | ChicagoTaxi (Demand) |
|---|---|---|
![]() |
![]() |
![]() |
| SHAP Explanation | Prometheus Metrics |
|---|---|
![]() |
![]() |
Common Patterns¶
- Health Check: All services return
{"status":"healthy"}at/health - Metrics: Prometheus format at
/metrics— custom counters per service - Validation: Pydantic schemas with automatic 422 error responses
- CORS: Enabled for all origins
- Structured Logging: JSON format in K8s, human-readable locally
Last Updated: March 2026 — v3.5.3







