Cloud Tiers & Models
Teachback routes cloud AI sessions through a Cloudflare Worker that proxies to different LLM providers based on your subscription tier.
The X-Tier header is sent with every request so the worker picks the right upstream.
Tier comparison
Section titled “Tier comparison”| Tier | Monthly price | Cloud model | Sessions/month | BYOK |
|---|---|---|---|---|
| Free | $0 | Gemini 2.5 Flash Lite | 50 | Gemini key |
| Standard | $4.99 | Gemini 2.5 Flash | Unlimited | Gemini key |
| Pro | $9.99 | GPT-4o | Unlimited | OpenAI key |
| Ultimate | $14.99 | Claude (Anthropic) | Unlimited | Anthropic key |
All tiers have unlimited local sessions (device-only, no cloud AI involved).
How tier routing works
Section titled “How tier routing works”Flutter app │ X-Tier: free | standard | pro | ultimate ▼Cloudflare Worker (tbapi.goappkit.com) │ ├─ free / standard ──▶ Google Gemini API ├─ pro ──▶ OpenAI API └─ ultimate ──▶ Anthropic APIWhen a BYOK key is present for your tier, the Flutter app bypasses the worker entirely and calls the provider API directly.
Quota system
Section titled “Quota system”Free-tier quota is enforced by a device_quota table in Supabase.
Each device is identified by a UUID stored in secure storage (iOS Keychain / Android EncryptedSharedPreferences).
The worker increments the session count via a Supabase RPC call on each successful completion.
When the count exceeds the tier limit, the worker returns HTTP 429 Too Many Requests.
Upgrading via the app
Section titled “Upgrading via the app”- Open Settings → Current Plan → Upgrade.
- Select a tier on the paywall screen.
- Complete the in-app purchase via the App Store or Google Play.
- Teachback verifies the purchase through RevenueCat and updates
currentTierProviderin real time.