Skip to main content

Set budgets and spend limits for Unity Gateway

Budgets help you monitor and control Unity Gateway spend, including Databricks-hosted usage and, when enabled, external model spend. You can scope a budget specifically to the Unity Gateway product to track only Unity Gateway spending, or include Unity Gateway in an account-wide budget.

Account and workspace admins can view a summary of AI budget status and spend on the AI page in Governance Hub.

tip

For budgets scoped to Unity Gateway, enforcement and alerts are near real-time. When spend crosses a threshold, usage blocking and alert emails take effect within moments, independent of system.billing.usage refresh timing.

Requirements​

  • Unity Gateway enabled for your account.

What budgets cover​

Unity Gateway budgets cover spend that flows through Unity Gateway, regardless of where the model runs:

Budgets don't cover provisioned throughput, or traffic sent directly to standalone Model Serving endpoints that doesn't flow through Unity Gateway.

Who can set up budgets​

  • Account admins: Create and modify budgets in the account console or with the Budget API.
  • Workspace admins: Create budgets scoped to the workspaces they administer, in Governance Hub or with the Budget API.
  • Delegated roles: To delegate budget management beyond admins, grant the Budget Manager or Budget Viewer role on an individual budget. See Who can do what.

Common budget setups​

Budgets give you a single cost-control plane over traffic routed through Unity Gateway, covering Databricks-hosted usage and, when enabled, external model spend. Use them to keep AI spend predictable and prevent unexpected costs.

Each setup below defines where a budget applies (its scope) and the limits it enforces (its thresholds). Amounts are examples. To configure a budget, see Create a budget.

Goal

Budget setup

Cap your organization's total AI spend

Scope the budget to the whole account. Add shared thresholds that send email at $40,000 and $45,000 and block usage at $50,000 a month. Set a $200 monthly per-user threshold, with a higher group override for power users.

Give each team its own allocation

Create a budget for each team's workspace. Add a shared threshold at the team's monthly allocation that blocks usage, and a lower one that emails the team lead.

Stop a user's runaway spend before it uses up their monthly budget

Add a daily per-user threshold that blocks usage, such as $25, alongside a monthly per-user threshold. A user whose spend spikes is blocked until 00:00 UTC instead of exhausting their monthly allowance. Add a group override with a higher daily limit for users who need it.

Limit use of your most expensive models

Tag those model services (for example, tier=frontier) and scope a budget to the tag. Add a low monthly per-user threshold that blocks usage. Users who reach it can still use other models.

Let everyone try new models without risking your budget

Tag new models' services (for example, tier=experimental) and scope a budget to the tag. Add a monthly per-user threshold that blocks usage. When you promote a model, remove the tag so new requests count toward your standard budgets.

Goal

Budget setup

Cap your organization's total AI spend

Scope the budget to the whole account. Add shared thresholds that send email at $40,000 and $45,000 and block usage at $50,000 a month. Set a $200 monthly per-user threshold, with a higher group override for power users.

Give each team its own allocation

Create a budget for each team's workspace. Add a shared threshold at the team's monthly allocation that blocks usage, and a lower one that emails the team lead.

Stop a user's runaway spend before it uses up their monthly budget

Add a daily per-user threshold that blocks usage, such as $25, alongside a monthly per-user threshold. A user whose spend spikes is blocked until 00:00 UTC instead of exhausting their monthly allowance. Add a group override with a higher daily limit for users who need it.

Limit use of your most expensive models

Tag those model services (for example, tier=frontier) and scope a budget to the tag. Add a low monthly per-user threshold that blocks usage. Users who reach it can still use other models.

Let everyone try new models without risking your budget

Tag new models' services (for example, tier=experimental) and scope a budget to the tag. Add a monthly per-user threshold that blocks usage. When you promote a model, remove the tag so new requests count toward your standard budgets.

Budgets are additive: a request counts toward every budget whose scope matches it. For example, an organization-wide cap can run alongside separate budgets for frontier and experimental models.

Account or workspace budgets​

Where a budget lives and who owns it depends on how your organization governs spend:

  • Centralized (account-level): A single budget managed at the account level. Best when you want uniform governance and don't want individual workspaces managing their own limits. At scale, segment users into tiers (for example, by role or cost center) instead of setting a limit per user.
  • Decentralized (workspace-level): Each workspace owns and manages its own budget. Best when teams or projects have independent ownership and accountability, such as when each workspace maps to one project and environment.
  • Hybrid: An account-level budget and workspace-level budgets coexist. A common pattern uses the account-level budget as a governance backstop that keeps spend governed even when a workspace hasn't set up its own budget, while workspaces manage their own day-to-day limits.
note

An account-level budget and a workspace-level budget are additive, not hierarchical. They apply independently and don't override each other.

Create a budget​

From a workspace, go to Unity Gateway > Govern > Budgets > Manage Budgets, then click Create budget.

To create a budget in the account console, go to Usage > Budgets > Create budget.

In Governance Hub, go to Cost > Budgets.

For the full steps, see Create a budget.

Budget configuration

To create budgets with code, use the Budget API or the databricks account budgets create command (account budgets command group).

Step 1. Choose the budget scope​

The scope decides which spend counts toward the budget. You can't change it after you create the budget.

  • Resource type: Select Unity Gateway to track only Unity Gateway spending.

  • Workspace and tags: Select one or more workspaces, or all workspaces, then, under Resource tags, click Select tags. Select tags becomes available after you make a workspace selection. Tag filters match service tags. Request tags don't affect which budget spend counts toward.

  • Include external model providers (Beta): Select this option to count estimated spend from external models. Databricks estimates this spend from token usage and the provider's published prices, adjusted by any price multiplier on the model provider service.

    Beta

    Including external model spend in budgets is in Beta. An account admin must enable the External Model Spend in Budgets preview from the account console Previews page. See Manage account-level previews.

Step 2. Set spending thresholds​

A budget can have the following thresholds:

  • Shared thresholds: A collective monthly spending limit for all users within the budget scope.
  • Per-user thresholds: A daily limit, a monthly limit, or both, that applies to each individual user. Daily thresholds track spend for each UTC calendar day and reset at 00:00 UTC. Monthly thresholds reset on the first day of each month.
  • Per-user overrides: Grant specific users or groups a higher daily or monthly spending limit than the default per-user threshold for that period. Users covered by an override can spend up to the override amount rather than the default per-user limit. If a user belongs to multiple override groups, the highest threshold for each period applies.

Step 3. Configure alerts and usage blocking​

For each shared and per-user threshold, choose one or more actions to take when spend reaches it. For per-user thresholds, you choose actions separately for the daily and monthly periods.

  • Send email: Sends an email notification to configured addresses. Users retain access to Unity Gateway.
  • Block usage: Prevents the user from making further requests through Unity Gateway. The user sees a message that their budget is exhausted. Access resumes after the threshold's period resets or an admin increases the threshold. Blocking is approximate. See Limitations.
  • Trigger webhook (Beta): Sends a JSON payload to one or more account-level webhook destinations. For per-user thresholds, the payload identifies the user who reached the threshold. An account admin must first enable the Account-level Webhook Destinations preview and create a destination. See Trigger custom webhooks.

Send email at lower thresholds so owners can react before spend stops, and reserve block usage for the highest shared threshold. Only the highest shared threshold can block usage.

Monitor budget spend​

Admins monitor spend against each budget in the account console. Workspace admins can use the Cost page in Governance Hub. Developers check their own limits from a terminal or through an API.

Monitor spend as an admin​

Account admins, and workspace admins for budgets they manage or view, see near-real-time spend on the budget details page. The Shared spend view shows the month-to-date estimate, the remaining budget, and a cumulative spend chart with thresholds. If the budget has per-user thresholds, the Users tab shows each user's spend and status: under, approaching, or exceeded.

Cumulative spend chart on a Unity Gateway budget details page

For a summary across budgets, account admins and workspace admins can use the AI page or the Cost page in Governance Hub. Workspace admins see budgets for their assigned workspaces.

Monitor spend as a developer​

Developers using coding agents can check their own limits from a terminal where ug is configured:

Bash
ug usage

The output shows up to five of your personal and shared limits, with the percentage used, the remaining amount, and the ID of the budget that enforces each limit. Run ug usage --all to see every applicable limit. See Check your usage.

To show users their spend in your own tools, call the Budget Spend Status API. It returns the calling principal's spend against a budget's blocking thresholds, and returns "not found" for a budget without a blocking threshold.

To help users find their limits and who to ask for more, see Show users their spend limits.

Best practices​

  • Grant overrides to groups, not individual users. Apply an override to a group so you can add more users to that group without creating a new override for each one. This scales better than direct per-user overrides, which each count toward the limit of 100 per budget. A practical way to define groups is by an attribute you already track, such as cost center, team, or role.
  • Keep an account-level backstop. When individual workspaces own their budgets, add an account-level budget as a backstop so that spend is still governed if a workspace hasn't set up its own budget.
  • Remember budgets are additive. In hybrid setups, account-level and workspace-level budgets both apply. One doesn't override the other.

Limitations​

important

Budgets for Unity Gateway provide a near real-time estimate of the spend tracked against the configured thresholds, and actual costs incurred may differ from configured thresholds. This feature is intended to help with near real-time cost control. Do not use this feature as a way to ensure an absolute spend cap on final billed amounts. Databricks is not responsible for costs incurred in excess of configured budget thresholds.

  • Task-specific AI Functions requests count toward Unity Gateway budgets, but aren't recorded in the system.ai_gateway.usage table. To view billed usage, query system.billing.usage. See View costs for AI Function workloads.

  • Each budget supports a maximum of four shared thresholds and 100 per-user overrides.

  • Your account can have a maximum of 1,000 budgets.

  • Block usage thresholds are enforced approximately. Enforcement uses a near-real-time estimate of cost, so actual spend may vary above or below the configured threshold. This means:

    • A user may be blocked before their actual spend reaches the threshold.
    • An amount of spend over the threshold may occur before enforcement takes effect. Active requests in progress when the threshold is reached are not interrupted.

    system.billing.usage remains the source of truth for actual Databricks-billed usage. For discrepancies between usage tracked against a budget and actual costs, Databricks may retroactively adjust budget estimates to reconcile them. For external model usage, the external provider invoice is the source of truth for actual provider charges.

  • Spend amounts in budget alert emails, the budget details page, system.billing.usage, and system.ai_gateway.external_model_spend may differ when compared at the same point in time. This is expected, because each source updates at a different rate:

    • Budget alert emails: Reflect spend at the moment the alert was triggered.
    • Budget details page: Updates frequently but may show a lower amount than a recent alert email when viewed shortly after.
    • system.billing.usage: Updates every few hours. Querying system tables shortly after receiving an alert may return a lower spend figure than the budget details page or alert emails.
    • system.ai_gateway.external_model_spend: Updates hourly with estimated external model spend. The estimates might differ from your final provider invoice.

Additional resources​