When to Use This
You’re building a production integration and need to:- Track credits across requests in your application (not just rely on dashboard)
- Estimate cost before making expensive calls (Mave, Focus Groups, Video Analysis)
- Alert when usage approaches 50%, 75%, 90% of monthly allocation
- Handle 402 gracefully — show users a clear message instead of a raw error
- Pre-flight check to avoid starting expensive jobs when credits are insufficient
Credit Costs at a Glance
Pattern 1: In-App Usage Tracking
Accumulatecredits_used from each response and persist it (e.g. Redis, DB) so you have real-time usage without polling the dashboard.
Pattern 2: Estimate Cost Before Calling
Before starting an expensive operation (focus group, video analysis), estimate the cost and compare against a threshold or remaining credits.Pattern 3: Pre-Flight Check (Block Expensive Jobs)
Before kicking off a focus group or video analysis, check estimated cost vs. remaining credits. Fail fast with a clear message instead of failing mid-run with 402.Pattern 4: Dashboard Budget Alerts
Configure alerts in the Mavera dashboard so you’re notified before you run out. No code required — just settings.1
Go to Usage Settings
Navigate to app.mavera.io/settings/usage
2
Set Alert Thresholds
Enable alerts at 50%, 75%, and 90% of monthly credits
3
Add Notification Email
Ensure the billing/ops email receives alerts
4
Optional: Workspace Budgets
For team accounts, set per-workspace budgets at Workspace Settings > Budget
Pattern 5: Auto-Recharge (Dashboard)
When credits run low, auto-recharge can automatically purchase more so high-priority jobs don’t fail.1
Go to Billing
2
Enable Auto-Recharge
Toggle on “Auto-recharge credits”
3
Set Threshold
e.g. Trigger when credits fall below 100
4
Set Recharge Amount
e.g. Purchase 500 credits
Pattern 6: Graceful Degradation on 402
When you get a 402, don’t show a generic “API error.” Return a clear message and optionally queue the request for retry after credits are added.Pattern 7: Per-Workspace Budgets (Teams)
For team accounts, set workspace-level and project-level budgets. When a budget is exceeded, requests for that workspace/project return 402 withbudget_exceeded.
Configure at Workspace Settings > Budget.
Metrics to Monitor
See Also
Credits Guide
Allocation, costs by endpoint, auto-recharge
Error Handling Patterns
Handling 402 in your error flow
Billing & Usage
Dashboard usage and alerts
Pricing
Plans and credit packages