Databricks Mosaic AI
Connect Databricks Mosaic AI Model Serving endpoints to Fabric Agents using a workspace host and bearer token. Serving endpoints are discovered automatically, with optional AI Gateway route overrides.
Databricks Mosaic AI Model Serving hosts foundation models (and your own deployed models) behind OpenAI-compatible serving endpoints in your workspace. Fabric Agents talks to them via the Pi SDK using bearer-token auth — a personal access token (dapi…) or a workspace OAuth token — so agents can run on Databricks-hosted models under your workspace's Unity Catalog governance.
When to use this provider
- Your organisation standardises on the Databricks Data Intelligence Platform and wants agent inference to stay inside the workspace boundary.
- You have one or more Model Serving endpoints (e.g.,
databricks-gpt-oss-120b,databricks-gpt-oss-120b, or a custom deployment). - You want serving endpoints to appear in the model picker automatically instead of curating a static list.
Prerequisites
- Your Databricks workspace URL — just the plain host:
https://<workspace>.cloud.databricks.com(AWS),https://adb-<id>.<n>.azuredatabricks.net(Azure), orhttps://<id>.gcp.databricks.com(GCP). A plain workspace URL lets Fabric Agents probe for AI Gateway v2. A gateway URL (…/ai-gateway/mlflow/v1, with or without a/serving-endpointssuffix) sets gateway availability explicitly. Both forms use the model routing rules below. - A token for that workspace: a personal access token (User Settings → Developer → Access tokens) or a workspace OAuth token. The principal needs
CAN_QUERYon the serving endpoints you want to use. - The optional AI Gateway route field accepts a named classic route from your workspace admin. Use a plain workspace URL to configure it. It applies to requests that use classic serving.
Connect in Fabric Agents
- Open Settings → AI → Connections → Add Connection.
- Choose Databricks Mosaic AI from the provider picker.
- Enter your workspace host and access token.
- With a plain workspace URL, optionally set an AI Gateway route for requests that use classic serving.
- Save. Fabric Agents validates the workspace URL, tests the connection against the serving-endpoints API, and discovers your endpoints.
Your serving endpoints appear in the model picker under a Databricks Mosaic AI group and refresh periodically to pick up newly deployed models.
How models are routed
Model IDs beginning with databricks- use OpenAI Chat Completions at /serving-endpoints, including on AI Gateway v2 workspaces. Workspaces without AI Gateway v2 also use classic serving. If you set a named route on a plain workspace URL, classic requests use /serving-endpoints/routes/<route>.
For other IDs on AI Gateway v2 workspaces, Fabric Agents uses advertised API types when available and infers the dialect from the model ID otherwise.
| Protocol | Gateway path | Example model ID |
|---|---|---|
| Anthropic Messages | /ai-gateway/anthropic | system.ai.claude-haiku-4-5 |
| OpenAI Responses | /ai-gateway/codex/v1 | system.ai.gpt-5 |
| Gemini | /ai-gateway/gemini/v1beta | system.ai.gemini-2-5-flash |
| OpenAI Chat Completions | /ai-gateway/mlflow/v1 | system.ai.gpt-oss-120b, my-custom-agent |
A model ID or endpoint name that contains gpt-oss as its own part of the name (at the start or end, or between -, . or _), for example system.ai.gpt-oss-20b, system.ai.gpt-oss-120b or custom-gemini-gpt-oss-20b, uses OpenAI Chat Completions. That holds even when the workspace advertises OpenAI Responses or another protocol for it, and even when the name also names another model family. In testing on 2026-11-19, the streaming Responses route returned their tool calls with empty arguments, while Chat Completions returned the full arguments.
The model picker excludes embedding and reranker endpoints.
Security notes
- Workspace URLs are validated against the official Databricks host patterns (AWS/Azure/GCP) before any request is made; redirects are not followed.
- AI Gateway route names are restricted to letters, numbers, hyphens, and underscores.
- Tokens are stored in the encrypted credential store and never logged; provider errors are sanitized before display.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Authentication failed (401)" | Token expired or invalid | Generate a new personal access token and re-enter it |
| "Permission denied (403)" | Principal lacks endpoint access | Grant CAN_QUERY on the serving endpoint |
| "hostname is not in the allowed list" | Non-Databricks host entered | Use the workspace URL exactly as shown in your browser address bar |
| "URL path must be empty … or '/ai-gateway/mlflow/v1'" | A path other than the AI Gateway base was included | Use the plain host, or exactly …/ai-gateway/mlflow/v1 to configure AI Gateway v2 explicitly |
| "route names are not used with an /ai-gateway/mlflow/v1 URL" | Named route combined with a gateway URL | Clear the AI Gateway route field, or switch to the plain workspace host |
| "API type '…' is not supported by '…'" | Endpoint reached over a protocol it doesn't advertise | Use Refresh models on the connection so routing re-reads the endpoint's advertised API types |
| Endpoint missing from the picker | Endpoint not ready, or created since last refresh | Wait for the endpoint to reach Ready, then use Refresh models on the connection |
Related
Building agents on Databricks (Genie, SQL Warehouses, Unity Catalog sources, workload templates)? See the Databricks integration section — this page only covers using Mosaic AI serving endpoints as an LLM provider.
Azure AI Foundry
Connect Azure-hosted OpenAI-compatible endpoints to Fabric Agents using Microsoft Entra ID (Azure AD) Bearer-token auth. Resource discovery, deployment selection, and token refresh are handled automatically.
Cloudflare AI Gateway
Route Claude, GPT and Workers AI models through your own Cloudflare AI Gateway from Fabric Agents, with the gateway's logging, caching and rate limits.