Skip to main content

Manage AI costs with Unity Gateway

Unity Gateway gives you one place to understand where AI spend goes, limit what users and teams can spend, automate budget management, and reduce spend. The following table shows the questions each page answers:

    • Track and analyze spend
    • Where does AI spend go? Query the usage and spend system tables, view the usage dashboard, and attribute spend with service and request tags.
    • Set budgets and spend limits
    • How do I limit spend? Create budgets with shared and per-user thresholds that send alerts or block usage, and show users their remaining budget.
    • Manage budgets at scale
    • How do teams own their budgets? Delegate budgets to team owners, receive threshold events with webhooks, and automate limit increase requests and approvals.
    • Control spending
    • How do I spend less? Set model defaults, use Smart Routing, and route to open-source models.

Get started​

To get started with Unity Gateway spend management, create a budget that controls Unity Gateway spend for a workspace: a monthly spending ceiling for the workspace, plus a per-user limit so that no single user uses up the budget. For details on every budget option, see Set budgets and spend limits for Unity Gateway.

Role required: Account admin, or workspace admin with Governance Hub enabled. See Access and permissions.

This example uses the following values. Replace them with your own.

Setting

Example value

Action

Scope

ml-prod workspace

Shared threshold

$10,000 per month

Block usage

Per-user threshold

$200 per month

Block usage

Per-user override (optional)

$1,000 per month for the ml-engineers group

Same as per-user threshold (Block usage)

Setting

Example value

Action

Scope

ml-prod workspace

Shared threshold

$10,000 per month

Block usage

Per-user threshold

$200 per month

Block usage

Per-user override (optional)

$1,000 per month for the ml-engineers group

Same as per-user threshold (Block usage)

  1. Check current spend to understand usage patterns and choose your limits.

    Go to Unity Gateway > Govern > Usage Dashboard. See View spend in the usage dashboard.

  2. Create a budget.

    1. Go to Unity Gateway > Govern > Budgets > Manage Budgets > Create budget.
    2. Select Unity Gateway as the resource type and the ml-prod workspace as the scope.
    3. To include external model spend in the ceiling, select Include external model providers. An account admin must first enable the External Model Spend in Budgets preview.
    4. Add the shared threshold, the per-user threshold, and the optional override from the table.
  3. Save the budget.

Then monitor spend against the budget:

  • Admins: in the account console, click Usage, then the Budgets tab, then the budget name. Workspace admins can use the Cost page in Governance Hub.
  • Developers: run ug usage in a terminal where the Unity Gateway CLI (ug) is configured. To install and configure ug, see ug CLI reference. To build a custom integration, call the Budget Spend Status API.

Additional resources​