Demand API¶
Project: projects/demand-api-observability-showcase
Summary¶
This API serves demand predictions from the demo model bundle used in the observability showcase.
Endpoints¶
| Method | Path | Purpose |
|---|---|---|
GET |
/health |
Service health check |
POST |
/predict |
Demand inference endpoint |
OpenAPI¶
- Download schema: demand-api.json
- Source schema in repo:
docs/api/assets/openapi/demand-api.json
Local Commands¶
Example Requests And Responses¶
Base URL for local runs:
GET /health¶
POST /predict¶
curl -s -X POST http://127.0.0.1:8000/predict \
-H "content-type: application/json" \
-d '{
"pickup_zone_id": 132,
"pickup_datetime": "2026-02-13T09:00:00Z"
}'
{
"pickup_zone_id": 132,
"pickup_datetime": "2026-02-13T09:00:00Z",
"predicted_pickups": 41.7,
"model_version": "demo-v1"
}
GET /metrics¶
This endpoint is part of the observability workflow and exposes Prometheus-formatted metrics.
# HELP http_requests_total Total HTTP requests by method and route.
# TYPE http_requests_total counter
http_requests_total{method="GET",route="/health"} 3.0
http_requests_total{method="POST",route="/predict"} 2.0
# HELP http_request_latency_seconds Request latency in seconds by method and route.
# TYPE http_request_latency_seconds histogram