Customization
How to brand and customize the ai-cost-gate dashboard.
ai-cost-gate's dashboard is a static SPA shipped from the binary. Customizing it is a matter of editing a few files in web/ and rebuilding.
Branding
Most teams only need to change:
web/index.html—<title>and meta tagsweb/public/favicon.svg— the faviconweb/src/components/Logo.tsx— the wordmark
Then rebuild:
cd web
pnpm install
pnpm buildThe build output (web/dist/) is embedded into the binary by go:embed in the next build step.
Provider pricing
Cost calculations come from internal/attribution/pricing.go. To update a model price, edit the corresponding entry in the prices map and rebuild.
If you want per-provider pricing JSON you can hot-reload without rebuilding, set PRICING_FILE=/path/to/pricing.json at startup. The file is re-read every 60 seconds.
Auth (Pro only)
Pro buyers can integrate the dashboard with their SSO via OIDC. Set:
OIDC_ISSUER=https://accounts.google.com
OIDC_CLIENT_ID=...
OIDC_CLIENT_SECRET=...After restart, the dashboard's login page shows a "Sign in with SSO" button.
Where to look in the code
- Project / agent tags —
internal/proxy/middleware/tagging.go. These read thex-acg-projectandx-acg-agentheaders on incoming requests. - Budget rules —
internal/budget/rules.go. Add a new rule type by implementing theRuleinterface. - Alert channels —
internal/alert/. Slack, Discord, email, and webhook channels are included.