2.1 KiB
2.1 KiB
Quota Management
Google Stitch free tier quota tracking and conservation strategies.
Limits
| Pool | Credits/Day | Reset |
|---|---|---|
| Daily Credits (generate, variants) | 400 | Midnight UTC |
| Redesign Credits (edit_screens) | 15 | Midnight UTC |
Each generation = 1 credit. Each variant = 1 credit. Each edit = 1 redesign credit (separate pool).
Local Tracking
Stitch SDK has no programmatic quota check endpoint. ClaudeKit tracks locally:
File: ~/.claudekit/.stitch-quota.json
{
"date": "2026-03-23",
"count": 42,
"limit": 400
}
Auto-reset: When date != today (UTC), count resets to 0.
Override limit: export STITCH_QUOTA_LIMIT="300" (if Google increases limits).
Warning Thresholds
| Remaining | Action |
|---|---|
| > 20% | Normal operation |
| < 20% | [!] Low quota warning printed |
| 0 | [X] Exhausted — exit code 2, suggest fallback |
Conservation Tips
- Use variants instead of regenerating — 3 variants = 3 credits vs regenerating 3 times = 3 credits, but variants are more purposeful
- Use
screen.edit()to refine — Editing costs 1 credit but preserves context - Export early — Don't regenerate just to see the design again; export HTML/image once
- Batch planning — Plan all designs for the day, generate in one session
- Review prompts — Better prompts = fewer regenerations
Fallback Workflow
When quota is exhausted:
stitch-quota.ts checkreturns exit code 2- Skill prints: "Daily quota exhausted. Use ck:ui-ux-pro-max as fallback."
- Activate
ck:ui-ux-pro-maxwith the same design prompt ui-ux-pro-maxgenerates text-based design spec (no external API needed)- Proceed with implementation using text-based spec
Drift Warning
Local tracking can drift if user generates designs outside ClaudeKit (via Stitch web UI or other tools). If you hit RATE_LIMITED error despite local tracker showing credits available:
- Run
npx tsx stitch-quota.ts reset - Set count to match actual usage (or leave at 0 if unknown)
- Stitch API itself enforces the real limit — local tracker is advisory only