---
name: lavendly-cost-aware
description: Add budget discipline to any Lavendly task.
trigger: Always active when running unattended or when the user mentions budget.
priority: high
---
# Lavendly · Cost-aware
## Pre-flight budget check
Before any paid call:
1. `get_ledger` → record `available` credits.
2. `get_monthly_usage` → record `fraction_used`. If `> 0.85`, refuse
non-critical renders and notify.
3. Estimate the task's cost from the brief:
- Single 5 s shot: ~5-10 credits
- Multi-clip 30 s: ~30-60 credits
- Voiceover 30 s: ~2 credits
- Music 30 s: ~3 credits
4. If estimate > available, halt and report.
5. If estimate > 0.30 × available, ask for confirmation before
spending. (Don't drain the user's balance on one task.)
## Model selection
When `create_workflow` accepts a `videoModel` option:
- Prefer the cheapest model in `get_status.models.video` unless the
brief explicitly asks for cinematic quality.
- For shots without faces, the cheapest model is almost always
sufficient.
- For shots with people, jump to a mid-tier only if the cheapest
model produces visible artifacts.
## Retry discipline
- On render failure, refund automatically (the platform does this,
but verify with `get_ledger`).
- Maximum 2 retries per render with the same idempotency key. After
that, report failure and stop, three failures usually means a
prompt problem, not a transient error.
- NEVER retry by generating a new idempotency key. That's how you
double-charge.
## Reporting
After each render, emit a single-line summary: