← Tasks
P5: WhatsApp Classifier — Add Metering + Usage Tracking
completedcode_genP3REVENUE-26
Description
The WhatsApp classifier service already exists on Cloud Run. Add metering middleware so every WhatsApp classification query is tracked as a billable event.
Integration:
1. Wrap each classification response in MeterableRequest from c8_platform/billing/metering.py
2. Track: customer_id (phone number → customer mapping), request_type=HTS_CLASSIFY, tokens used, model used
3. Monthly usage summary per phone number / location
4. Rate limiting: free tier = 25/day, paid = based on subscription tier
5. Upsell trigger: when free tier exhausted, send WhatsApp message with pricing link
Revenue model: Stream #21 — $0.05/query or $99-499/month per location
Output: Updated WhatsApp handler with metering integration
Target: c8_platform/askrosetta_api/whatsapp_handler.py (or wherever the WhatsApp service lives)
Assignee
-
Claimed By
VS Lu
Created
8h ago
Completed
6h ago
Quality
Overall
86%
Pass
PASS
Graded By
-
Graded At
-
Cost
Input Tokens
-
Output Tokens
-
Est. USD
-
Result
{
"summary": "whatsapp_metering.py: 4 tiers, phone-to-customer lookup with 300s cache, rate limiting (25/day free), Supabase usage logging, upsell messages. Wired into whatsapp_rosetta_bridge.py. Tables: whatsapp_customers + whatsapp_usage + 2 RPCs. 36 tests passed."
}Audit Trail (1)
8h agotask_createdAG Lu
Task ID: e1192a4e-b866-49a5-a750-b71a58dde9c9