Context
We've added OpenAI and Google Gemini keys to opencode-zen. Both providers offer complex pricing:
- OpenAI: Free tier with daily token allowance under data-sharing agreement, then paid
- Google Gemini: Similar free tier deal with limits
- OpenCode: Always free
- Claude Max / Copilot: Subscription-based with monthly limits
Problem
Current budget orchestrator treats providers as either subscription or paid-per-token. Need hybrid support:
- Free tier until daily/monthly limit reached
- Automatic fallback when free tier exhausted
- Preference for free providers when available
Requirements
1. New Provider Types
hybrid-free-then-paid: Free tier until limit, then paid
hybrid-free-daily: Daily free reset
2. Free Tier Tracking
3. Provider Selection Priority
- Free tier available (opencode, openai/google within limits)
- Subscription with headroom (Claude Max, Copilot)
- Paid-per-token (when budget allows)
4. Parallel Agent Optimization
Distribute across free tiers for more parallel agents without cost.
5. Files to Modify
src/features/budget-orchestrator/
src/features/usage-tracker/
src/config/schema.ts
Success Criteria
Context
We've added OpenAI and Google Gemini keys to opencode-zen. Both providers offer complex pricing:
Problem
Current budget orchestrator treats providers as either subscription or paid-per-token. Need hybrid support:
Requirements
1. New Provider Types
hybrid-free-then-paid: Free tier until limit, then paidhybrid-free-daily: Daily free reset2. Free Tier Tracking
3. Provider Selection Priority
4. Parallel Agent Optimization
Distribute across free tiers for more parallel agents without cost.
5. Files to Modify
src/features/budget-orchestrator/src/features/usage-tracker/src/config/schema.tsSuccess Criteria