Returns current billing period usage statistics for an SGTM container.
This Edge Function provides real-time usage data for billing and analytics, combining aggregated daily usage with today's live log count to show accurate hits used, remaining quota, and over-limit status.
GET /functions/v1/sgtm_container_usage?container_id=<uuid>
Service role - uses SUPABASE_SERVICE_ROLE_KEY.
SUPABASE_SERVICE_ROLE_KEY
sgtm_usage_daily
sgtm_access_logs
sgtm_container_subscriptions
billing_plans
Returns current billing period usage statistics for an SGTM container.
Overview
This Edge Function provides real-time usage data for billing and analytics, combining aggregated daily usage with today's live log count to show accurate hits used, remaining quota, and over-limit status.
Endpoint
GET /functions/v1/sgtm_container_usage?container_id=<uuid>Authentication
Service role - uses
SUPABASE_SERVICE_ROLE_KEY.Behavior
sgtm_usage_dailysgtm_access_logsTables Touched
sgtm_container_subscriptions(read)billing_plans(read)sgtm_usage_daily(read)sgtm_access_logs(read)Notes