Databricks AI Gateway: how Unity Gateway works, what it costs, and its limits
Databricks AI Gateway is the managed layer that governs how applications and agents call models, external model providers, and MCP servers through a Databricks workspace, and Databricks now documents it as Unity Gateway. The product became generally available on August 4, 2026 as part of Unity Catalog, so access to a model is granted the same way as access to a table. This explainer covers the naming, how a request flows, each control, pricing, and the documented limits as of November 2026.
What is Databricks AI Gateway?#
Databricks AI Gateway, now named Unity Gateway, is a managed AI gateway inside Unity Catalog that routes, limits, filters, and logs requests to models and Model Context Protocol servers. It is not a separate service to deploy: it is part of the Databricks platform in supported regions, and every asset it governs is a Unity Catalog object.
The Unity Gateway docs describe one control plane for model inference, tools, and skills, covering four jobs:
- Access: Unity Catalog privileges decide who can call each model, provider, or MCP service.
- Traffic: rate limits, traffic splitting, fallbacks, and budgets shape volume and destination.
- Content: service policies allow, deny, or pause requests and responses.
- Records: system tables, inference tables, and audit logs record usage, payloads, and callers.
Unity AI Gateway, Unity Gateway, and AI Gateway: one product#
Unity Gateway is the current name. Databricks' renamed products page lists AI Gateway, Unity AI Gateway, and Mosaic AI Gateway as former names of the same product, so searches for "databricks unity ai gateway" and "databricks ai gateway" lead to the same documentation. The older names still appear in URLs, APIs, and the workspace interface.
Databricks' April 15, 2026 announcement moved AI Gateway into Unity Catalog under the Unity Gateway name. The August 2026 GA announcement still lives at a URL ending in unity-ai-gateway-generally-available.
The product to keep separate is the older one. Databricks now calls it AI Gateway (legacy) for serving endpoints: governance attached to individual model serving endpoints, where fallbacks worked only for external models and AI Guardrails were a Public Preview.
| Identifier you may see | Where it appears | Product |
|---|---|---|
| AI Gateway (menu label) | Workspace UI steps on several docs pages | Unity Gateway |
/ai-gateway/mlflow/v1, /ai-gateway/openai/v1 |
Query routes for hosted and external models | Unity Gateway |
system.ai_gateway.usage |
Usage system table | Unity Gateway |
Databricks-Ai-Gateway-Request-Tags |
Request header for cost attribution | Unity Gateway |
databricks ai-gateway, databricks_ai_gateway_model_service |
CLI command group, Terraform resource | Unity Gateway |
/serving-endpoints, regional *.ai-gateway.* host |
Base URLs of older clients | Legacy AI Gateway |
Moving off the legacy product is a rebuild: the migration guide states that governance on a legacy endpoint does not carry over, so permissions, rate limits, fallbacks, inference tables, and budgets must be re-created before clients switch routes.
How Databricks AI Gateway handles a request#
A request receives Unity Gateway controls only when it reaches a gateway route. On that route the caller authenticates with a personal access token or OAuth, Unity Catalog checks the EXECUTE privilege, rate limits and budgets apply, service policies inspect the content, and the model service selects a destination. Usage lands in Unity Catalog system tables.
Applications call the gateway with an OpenAI-compatible client pointed at the workspace. The quickstart uses the Responses API, which Databricks recommends over Chat Completions, and a fully qualified model name:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DATABRICKS_TOKEN"],
base_url="https://<workspace-url>/ai-gateway/mlflow/v1",
)
response = client.responses.create(
model="system.ai.<model-name>",
input=[{"role": "user", "content": [{"type": "input_text", "text": "Hello"}]}],
)Every governed asset has a three-part catalog.schema.name, as the concepts page explains. The main object types are:
- Model service: the endpoint callers hit. System-provided services live in
system.ai; custom services route to one or more models with traffic splitting and fallbacks. - Model provider service: stored, encrypted credentials for an external provider such as OpenAI, Anthropic, or Amazon Bedrock.
- MCP service: a governed set of tools that agents discover and call.
- Skill: reusable instructions and files that an agent loads.
Four privileges control these objects: EXECUTE to call, CREATE SERVICE to create, READ METADATA to inspect, and MANAGE to change and grant. Callers also need USE CATALOG and USE SCHEMA. Model services use definer's privileges, so Databricks checks the service owner's access to each destination rather than the caller's.
Rate limits, traffic splitting, and fallbacks#
Model services accept requests-per-minute (QPM) and tokens-per-minute (TPM) limits, while MCP services accept QPM only. Limits can apply to the whole service, as a per-user default, to specific users or service principals, or to groups. Traffic splitting spreads requests across up to 5 destinations, and fallbacks retry failed requests in a fixed order.
The rate limits page sets these rules for rate limiting:
- The service limit is a ceiling: once it is exceeded, every request is blocked regardless of user or group limits.
- A user-specific limit beats a group limit, and any custom limit beats the default.
- When QPM and token limits both apply, the stricter one wins.
- A service holds up to 20 rate limits, of which up to 5 can be group limits.
- New services have no limits, and callers over a limit receive HTTP 429.
Enforcement is approximate: each service instance enforces limits on its own and records usage after the response, so short bursts above a limit can pass.
The traffic splitting page requires split percentages to sum to 100. Routing is random per request, and requests with a session-identifying header stay on one destination. Fallbacks trigger on failures such as 429 and 5xx errors. Fallback destinations cannot have their own split, and a retry does not reapply the split. Each routing decision is written to the routing_information field of system.ai_gateway.usage. The LLM routing guide covers other strategies.
Databricks AI Gateway budgets and usage tracking#
Budgets compare a near-real-time spend estimate against thresholds and then send an email, block further usage, or call a webhook, which is in Beta. Usage tracking writes per-request metadata to system.ai_gateway.usage. Together they attribute cost to people and teams, but neither one is an exact billing record.
The budgets page lists these settings as of November 2026:
- Up to four shared monthly thresholds per budget, and only the highest one can block usage.
- Per-user daily thresholds that reset at 00:00 UTC, and monthly thresholds that reset on the first of the month.
- Up to 100 per-user or per-group overrides per budget, and up to 1,000 budgets per account.
- Coverage of pay-per-token usage, AI Functions, and Genie. External provider spend counts only when "Include external model providers" is selected, which needs a Beta preview.
- No coverage of provisioned throughput or of traffic sent straight to standalone Model Serving endpoints.
Blocking is approximate: a user can be blocked slightly early or run slightly past a threshold, and requests already in progress finish.
Usage tracking covers model services, model provider services, and MCP services, from sources including ai_query, coding agents, Databricks Apps, and AI Playground. Records usually arrive within an hour, and only account and metastore admins can query the table until they grant access. A Databricks-Ai-Gateway-Request-Tags header attributes requests to a team or project. Token usage is not tracked for non-streaming, non-embedding responses larger than 1 MiB.
Databricks AI Gateway guardrails: service policies#
Service policies are Unity Gateway's guardrails. They inspect requests and responses and return ALLOW, DENY, or ASK. As of November 2026 they are in Beta, and a workspace admin must enable the Unity Gateway Service Policies preview first. Policies attach to model services, model provider services, and MCP services, but not to agent services.
The service policies page describes three kinds:
- Built-in:
block_unsafe_content,block_jailbreak,block_hallucination, anddetect_sensitive_datainsystem.ai. The jailbreak policy also screens for prompt injection, and the sensitive data policy is pattern-based and can mask matches. - Custom: a SQL function, a Python function, or a natural-language LLM-as-a-judge prompt.
- External: a call to a third-party guardrail vendor over a Unity Catalog HTTP connection.
Several behaviors matter for client code. A blocked chat request returns HTTP 200 with an assistant turn that names the policy and a databricks_service_policy object holding the reason, so a client that checks only status codes treats a block as a success. Policies fail closed: evaluation errors, timeouts, and misconfigured policies all produce DENY. Legacy text completion requests skip evaluation entirely, and any request for more than one response (n above 1) returns HTTP 400 while a policy is attached.
Streaming output is checked in overlapping windows by default, and approved text is released early. If a later window fails, the stream ends, but text already sent stays with the client; Full response evaluation buffers the whole answer instead. Built-in policies carry no separate fee during the Beta, but each LLM-judge evaluation is billed as a call to the evaluator model.
Inference tables and audit logs#
Inference tables store full request and response payloads for a model service in a Unity Catalog Delta table, and system.access.audit records who called which AI service and when. Payload logging is opt-in per model service and billed by volume. The audit log can separate a human caller from an agent acting on that person's behalf.
Inference tables are set up per model service after it exists, with Set Up next to Inference tables. Plan around these gaps:
- Rows can take up to an hour to appear.
- Requests and responses larger than 10 MiB are not logged.
- Requests that return 401, 403, 429, or 500 may not be logged.
- Tables cannot be created in storage secured through a private endpoint.
The observability page names the run_by and run_as audit fields that tell a person apart from an agent acting for them, and also lists a usage dashboard and a Metrics tab on each service. A unified trace table that stores requests and responses in OpenTelemetry format entered Beta in August 2026. Gateway records show per-request facts; application-level tracing is covered in the guide to LLM observability.
MCP servers and coding agents#
Unity Gateway governs an MCP server the same way as a model: grant EXECUTE, choose which tools it exposes, and cap tools/call requests with a QPM limit. Coding agents connect through Databricks' ug CLI, which applies the organization's models, MCP servers, and skills, and shows each developer's spend against personal and shared limits.
The MCP governance page sets the tool rules. Tools can be selected by exact name or by a prefix such as get_*, but exclusion patterns such as !delete_* are not supported. Unselected tools disappear from tools/list, and calls to them are rejected. An MCP service cannot be renamed after creation. On MCP services, an ASK verdict from a service policy pauses the tool call for human approval; on model services, ASK blocks instead. The MCP security guide covers the threats these controls address.
The coding agent quickstart installs ug with uv tool install git+https://github.com/databricks/unity-gateway on Python 3.12 or later. After ug configure, developers launch agents with ug claude, ug codex, ug gemini, ug opencode, ug copilot, or ug pi. For how these agents compare, see the AI coding agents guide.
Databricks AI Gateway pricing#
Unity Gateway has no separate charge for managing models or MCP services. As of November 2026, the Unity Gateway pricing page lists two paid features, usage tracking and inference tables, billed only when turned on, at $0.10 per GB in AWS US East (N. Virginia) on both the Premium and Enterprise tiers.
| Cost component | How it is billed (as of November 2026) |
|---|---|
| Usage tracking and inference tables | $0.10 per GB each in AWS US East (N. Virginia), in 1 KB payload increments |
| Permissions, rate limits, traffic splitting, fallbacks | No Unity Gateway charge |
| Databricks-hosted models | Usual rates for those models, with no gateway fee added |
| External provider models | Paid to the provider directly |
| LLM-judge service policies | Billed as calls to the evaluator model; built-in policies carry no separate fee during Beta |
Gateway charges appear under the Serverless Real-time Inference SKU, and prices vary by region. Logging can be on without anyone enabling it by hand: Databricks' July 17, 2026 release note says usage and spend tracking are on by default for external model providers.
Documented limits to plan around#
The limits most likely to change a design concern regions, which traffic gets which controls, and Beta status. Unity Gateway is not supported on AWS GovCloud, ai_query receives usage tracking only, and service policies, agent services, Smart Routing, and skills remain in Beta as of November 2026.
| Control | Model services (SDK and API) | ai_query in SQL |
MCP services |
|---|---|---|---|
Unity Catalog EXECUTE grants |
Yes | System-provided services only | Yes |
| Rate limits | QPM and TPM | No | QPM only |
| Traffic splitting and fallbacks | Yes | No | Not documented |
| Service policies (Beta) | Yes | No | Yes, including ASK approval |
| Usage tracking | Yes | Yes | Yes |
| Inference tables | Yes | No | Not documented |
Per the query docs, ai_query also cannot call custom model services yet. Other documented limits:
- Regions: the AWS region support table lists 13 regions, including us-east-1, us-west-2, eu-west-1, and ap-south-1, and omits us-west-1, eu-west-3, ap-southeast-3, and GovCloud.
- Management: the model services page says custom model services cannot be managed with SQL, found with
BROWSEalone, or located through global search. - Enforcement: turning on Enforce Unity Gateway disables the
databricks-pay-per-token endpoints, so old clients getPERMISSION_DENIED, and Knowledge Assistant and Multi-Agent Supervisor agents that depend on AI Search endpoints stop working.
When Databricks AI Gateway fits#
Unity Gateway fits organizations whose AI traffic already starts inside Databricks: SQL pipelines, Databricks Apps, notebooks, and coding agents run through ug. Model access becomes Unity Catalog grants that platform teams already manage, and usage lands in system tables next to billing data. The fit is weaker when much of the traffic originates outside Databricks.
Four situations point to another layer, either alone or alongside Unity Gateway:
- Workloads in AWS GovCloud or in regions outside the support table.
- Batch
ai_querypipelines that need rate limits, guardrails, or fallbacks. - Applications running on other clouds or on-premises that should not depend on a Databricks workspace.
- Teams that need an exact spend cap, since budgets block approximately and in-flight requests finish.
A standalone gateway, self-hosted or managed, covers those cases with its own trade-offs, set out in the explainer on what an AI gateway is. Next, the AI gateways directory lists Unity Gateway beside other options by deployment model, and the AI gateways hub collects related guides on routing, caching, and observability.
Frequently asked questions
What is Databricks AI Gateway v2?
- Searches for Databricks AI Gateway v2 usually mean Unity Gateway, the Unity Catalog-based version that replaced governance on individual model serving endpoints. Databricks calls the older product AI Gateway (legacy) and recommends Unity Gateway instead. Settings on a legacy endpoint, such as permissions, rate limits, and inference tables, do not carry over, so teams re-create them on model services and point clients at the new routes.
How much does Databricks AI Gateway cost?
- Unity Gateway has no separate charge for managing models or MCP services. As of November 2026, Databricks bills two features when they are turned on: usage tracking and inference tables, each at $0.10 per GB on AWS in US East (N. Virginia), counted in 1 KB payload increments. Databricks-hosted models are billed at their usual rates, and external providers bill their own usage directly.
Is Databricks Unity AI Gateway open source?
- No. Unity Gateway is a managed feature of the Databricks platform and is available only through Databricks workspaces. The ug command-line tool that connects coding agents has public source code on GitHub, but it ships under the Databricks License, which permits use only in connection with Databricks services. Teams that need a self-hosted, open source gateway have to run a separate product.
Does Databricks AI Gateway work with Claude Code?
- Yes. Databricks' ug CLI configures Claude Code to send its model traffic through Unity Gateway, and developers start it with ug claude after running ug configure. The same tool supports Codex, Gemini CLI, OpenCode, GitHub Copilot CLI, and Pi. Developers can switch only among models their organization makes available, and ug usage shows their spend against personal and shared limits.
Can Databricks AI Gateway route to OpenAI and Anthropic models?
- Yes. External providers are registered as model provider services that hold encrypted credentials. As of November 2026 the supported providers are OpenAI, Azure OpenAI, Anthropic, Amazon Bedrock, Amazon Bedrock Mantle, Microsoft Foundry, Google Gemini Enterprise, and a Custom option for other endpoints. Callers reference the provider service by its three-part Unity Catalog name and never see the stored keys.
Can you manage Databricks AI Gateway with Terraform?
- Yes. Model services can be created with the databricks_ai_gateway_model_service Terraform resource, the databricks ai-gateway CLI command group, the Python SDK, or the REST API at /api/2.1/unity-catalog/model-services. Databricks made the Unity Gateway API for model, provider, and MCP services generally available across Terraform, the CLI, and SDKs on September 16, 2026. Deployment through Declarative Automation Bundles, formerly Databricks Asset Bundles, is still in Beta.
Terms in this guide
Cite this guide
The AI Engineering Editors. "Databricks AI Gateway: how Unity Gateway works, what it costs, and its limits." The AI Engineering, updated Nov 26, 2026. https://theaiengineering.com/articles/databricks-ai-gateway
- Title
- Databricks AI Gateway: how Unity Gateway works, what it costs, and its limits
- Author
- The AI Engineering Editors
- Publisher
- The AI Engineering
- Published
- Updated