ACG Docs

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 tags
  • web/public/favicon.svg — the favicon
  • web/src/components/Logo.tsx — the wordmark

Then rebuild:

cd web
pnpm install
pnpm build

The 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 tagsinternal/proxy/middleware/tagging.go. These read the x-acg-project and x-acg-agent headers on incoming requests.
  • Budget rulesinternal/budget/rules.go. Add a new rule type by implementing the Rule interface.
  • Alert channelsinternal/alert/. Slack, Discord, email, and webhook channels are included.

On this page