Guide

Cost Optimization

FORG gives you real-time visibility into AI spend and the rules to act on it. This guide walks through the highest-impact strategies for reducing costs without impeding developer productivity.

1. Establish a baseline first

Before setting limits, run FORG in observe-only mode for 1–2 weeks. This gives you accurate data on actual usage patterns — daily spend, peak hours, highest-cost users, and which models dominate.

In Dashboard → Analytics → Cost Breakdown, sort by user and model. Typically, 20% of users account for 80% of spend. Start there.

2. Right-size model selection

The largest cost lever is usually model choice. If developers default to the most capable model for every task, significant cost reduction is possible by routing simpler tasks to cheaper models.

Create a rule to alert when a high-cost model is used frequently:

// Rule: flag heavy Opus usage
{
  "name": "High-cost model alert",
  "condition": {
    "model": { "in": ["claude-opus-4-5"] },
    "tokens_in": { "gt": 50000 }   // large context = expensive
  },
  "action": "notify",
  "notify_channels": ["slack"]
}

3. Set daily per-user budgets

A daily per-user cap prevents outlier days from dominating the monthly total. Start with 2x the p75 daily spend — high enough to never block a productive developer, low enough to catch runaway automation.

// Rule: daily user cap
{
  "name": "Daily per-user limit",
  "scope": "user",
  "window": "1d",
  "condition": {
    "cost_usd": { "gt": 25 }
  },
  "action": "block",
  "reset": "midnight"
}

4. Control automated scripts

CI/CD pipelines and test harnesses that call AI APIs often run without human review and can consume large amounts of tokens silently. Tag automation by project and apply tighter limits:

// Rule: stricter cap for CI project
{
  "name": "CI automation budget",
  "scope": "project",
  "condition": {
    "project_id": { "eq": "proj_ci_pipeline" },
    "cost_usd": { "gt": 5 }
  },
  "window": "1d",
  "action": "block"
}

5. Set a hard monthly org cap

A monthly org-level budget cap ensures a runaway rule misconfiguration or an unexpected spike cannot produce a bill you cannot absorb:

// Rule: monthly org hard cap
{
  "name": "Monthly org ceiling",
  "scope": "org",
  "window": "month",
  "condition": {
    "cost_usd": { "gt": 2000 }
  },
  "action": "block"
}

6. Review and tighten over time

After 30 days with limits active, review the Rules → Trigger log page. Rules that never trigger can be tightened. Rules that trigger frequently for legitimate work need to be loosened or scoped more precisely.

A good target: rules should trigger fewer than 5 times per user per month. More than that indicates the limit is too low for actual work.

© 2026 UpgradIQ, Inc.Edit this page on GitHub