---
id: "13.3"
title: "Spend caps"
dept: finance
status: draft
owner: Param
branded: false
last_verified: 2026-10-26
sources:
  - "brew origin/main a559de6: tools/prod-env.sh:9, deploy.sh:21 and 41, build.js:113-115 and 1069-1076, budget.js:12-16, rewrite-pot.js:14-24 and 71, drafts-bg.js:13 and 142, moves-cadence.js:406, social-feed.js:274, listen-watch.js:10 and 684, market-pulse.js:318, brand-enrich.js:9, treg.js:45 and 82, shelf.js:6 and 69, apify.js:4 and 42, server.js:564-566, jam2/routes.js:238 and 310-317"
  - "memory: brew-pro-switch-and-flush, brew-connect-refresh, brew-move-freshness, brew-sloosh-finals, brew-viral-remakes, brew-apify-watch, treg-usage-rules"
---

# Spend caps

## Answer

Every limit in Brew that stops money being spent, its value on production, its default in the code and why it exists; production sets most of them in one place, `tools/prod-env.sh`.

## Today

### Whole server, per day

| Cap | Production | Code default | What it stops | Source |
|---|---|---|---|---|
| `TREG_DAY_CAP_USD` | $40 | $25 | All outside data calls through treg in a day, across instances | [src: brew/tools/prod-env.sh:9] [src: brew/treg.js:45] [src: brew/treg.js:82] |
| `DAILY_BUILD_CAP_USD` | $250 | $200 | All first builds of Plays in a day, across brands | [src: brew/tools/prod-env.sh:9] [src: brew/build.js:114] |
| `DAILY_TEXT_CAP` | 1,500 units | 400 | AI writing calls in a day | [src: brew/tools/prod-env.sh:9] [src: brew/budget.js:13] |
| `DAILY_IMAGE_CAP` | 1,500 | 60 | Pictures in a day; about $58 at worst on Flash | [src: brew/tools/prod-env.sh:9] [src: brew/budget.js:13] [src: brew/deploy.sh:21] |
| `DAILY_VIDEO_CAP` | 60 | 15 | Videos in a day | [src: brew/tools/prod-env.sh:9] [src: brew/budget.js:13] |
| `DAILY_VOICE_CAP` | not set, so 60 | 60 | Voice clips in a day | [src: brew/budget.js:13] |
| `DAILY_CREDITS_CAP` | not set, so 300 | 300 | Sloosh credits for finals in a day | [src: brew/budget.js:13] [src: memory brew-sloosh-finals] |

### Per brand

| Cap | Production | Code default | What it stops | Source |
|---|---|---|---|---|
| Brand share of each daily cap | a third | a third, `DAILY_BRAND_SHARE` | One brand using the whole day | [src: brew/budget.js:14-15] |
| `BRAND_VIDEO_CAP` | 20 a day | a third of the video cap | Videos for one brand | [src: brew/tools/prod-env.sh:9] |
| Pictures kept for the team | 40 a day | `BG_RESERVE_IMAGE` 40, video 8, voice 10 | Background drafts using the team's last pictures | [src: brew/server.js:564-566] |
| `BUILD_CAP_USD` | $45 a build | $60 | One brand's first build of every Play | [src: brew/tools/prod-env.sh:9] [src: brew/build.js:113] |
| Pro brand build | $150 | the larger of $150 and 2.5 times the build cap | A brand marked Pro | [src: brew/build.js:115] |
| `BRAND_WEEK_CAP_USD`, the rewrite pot | $40 a week on Pro Plays | $10 Flash, $40 Pro, $50 Claude | Weekly rewrites that keep Plays fresh | [src: brew/rewrite-pot.js:20-21] [src: brew/rewrite-pot.js:71] |
| `CONNECT_CAP_USD` | $40 a run | $40 | Rewrites after a first connected account | [src: brew/build.js:1070] [src: memory brew-connect-refresh] |
| `LEARN_CAP_USD` | $30 an upload | $30 | Rewrites after a learnings drop | [src: brew/build.js:1075] |
| `LIVE_CAP_USD` | $30 a run, weekly | $30 | Rewrites after connected numbers move 10% | [src: brew/build.js:1076] [src: memory brew-move-freshness] |
| `REFRESH_CAP_USD`, `REFRESH_AUTO_CAP_USD` | $60 by hand, $10 automatic | same | A site check refresh | [src: brew/build.js:1069] |
| `DRAFTS_DAY_CAP_USD` | $4 a day | $4 | Background first drafts | [src: brew/drafts-bg.js:13] [src: brew/drafts-bg.js:142] |
| `MOVES_WEEK_CAP_USD` | $3 a week | $3 | Weekly listening, automation and learn Plays | [src: brew/moves-cadence.js:406] |
| `SOCIAL_DAY_CAP_USD` | $3 a day | $3 | Listening and the ideas stream | [src: brew/social-feed.js:274] |
| `APIFY_BRAND_MONTH_CAP_USD` | $10 a month | $10 | Apify scrapers for one brand | [src: brew/tools/prod-env.sh:9] [src: brew/shelf.js:69] |

### Per run

| Cap | Value | What it stops | Source |
|---|---|---|---|
| `LISTEN_RUN_CAP_USD` | $0.60, lite $0.15 | One listening run | [src: brew/listen-watch.js:684] [src: brew/social-feed.js:274] |
| `PULSE_CAP_USD` | $3 | One market pulse run | [src: brew/market-pulse.js:318] |
| Brand Book enrichment | $0.50 | One enrichment run | [src: brew/brand-enrich.js:9] |
| Apify `maxTotalChargeUsd` | per actor, such as $0.45 for Trustpilot | One scraper run | [src: brew/apify.js:4] [src: brew/apify.js:42] |

### Paid makes

| Rule | Source |
|---|---|
| Every Studio make, redo, extend and final needs a confirmed price; a higher price than confirmed stops the make | [src: brew/jam2/routes.js:238] [src: brew/jam2/routes.js:310-317] |
| Sloosh's own daily agent limit, raised from 50 to 200 credits on 21 Oct; a brand's share of finals is 100 credits a day | [src: memory brew-viral-remakes] [src: brew/budget.js:13-15] |

## Tomorrow

| Item | Version | Tag |
|---|---|---|
| Every cap above | v1 | Stays |
| One monthly ceiling per brand across every source | v1 | New, proposed in [cost per brand](/ai-and-models/cost-per-brand) |
| Caps follow the brand's plan once pricing exists | v1, after pricing | Changes |
| Ad spend caps the owner sets per area and channel | v4 | New |

## How we do it

1. Change a production cap only in `tools/prod-env.sh`, with a comment saying why, then promote.
2. Before moving Plays to a dearer model, raise the caps that follow it: `BUILD_CAP_USD`, `BRAND_WEEK_CAP_USD` [src: memory brew-pro-switch-and-flush].
3. Any new paid call gets three things: a cap in env, a per brand share and a tag that books it to the brand.
4. When a cap is hit, the product says so in plain words and carries the work to the next day; it never fails silently.
5. Check the treg balance live before blaming treg for a stop [src: memory treg-usage-rules].

## Numbers

| Metric | Definition | Where measured | Status |
|---|---|---|---|
| Cap hits a week | Times any cap stopped work, by cap | Server logs and ops alerts | Proposed |
| Worst case daily spend | Sum of the daily dollar caps | This page | Proposed: about $348 from treg $40, builds $250 and pictures about $58, before per brand caps |

## Open

1. **Is $250 a day of first builds right for production?** Proposal: keep it; five partners at $45 a build fit, and a new brand waits a day past that.
2. **The build cap default in code is $60 but production runs $45.** Proposal: set the code default to $45 so a missing env var never spends more.
3. **A monthly ceiling per brand.** Proposal: $50 a brand a month across all sources during the partnership, raised only by Param.
