Integrate coding agents with model provider services

Important

this feature is in Beta. Account admins can manage access to this feature from the account console Previews page. See Manage Azure Databricks previews.

This page describes how to route coding agents like Claude Code and Codex CLI through a model provider service. The agent runs against an external provider you registered in Unity Catalog, such as your own OpenAI, Anthropic, or Amazon Bedrock account. Unity AI Gateway supplies the stored credentials at request time and applies governance and usage tracking, so the coding agent doesn't handle the provider's secret.

To route an agent to Azure Databricks-provided models instead, see Integrate with coding agents.

Features

  • Bring your own provider. Point Claude Code or Codex CLI at your own OpenAI, Anthropic, Amazon Bedrock, or other registered provider through a single governed Unity Catalog securable.
  • Centralized governance. The EXECUTE privilege gates access to the model provider service, and you can apply rate limits and service policies at the service level.
  • Observability. Unity AI Gateway captures requests in usage tracking and, when configured, inference tables.

Requirements

Route a coding agent to a model provider service with ucode

ucode (Unity AI Gateway Coding CLI) installs, authenticates, and configures supported coding agents to route through Unity AI Gateway. To route an agent through a model provider service instead of Azure Databricks-provided models, pass the service's three-part name to --provider.

Step 1: Install ucode

uv tool install git+https://github.com/databricks/ucode

###Step 2: Open an agent against a model provider service

Pass the model provider service's fully qualified name (<catalog>.<schema>.<name>) to --provider:

ucode claude --provider main.default.openai_prod    # Claude Code
ucode codex --provider main.default.openai_prod     # Codex CLI

On first open, ucode prompts for your Azure Databricks workspace URL, authenticates, and writes the agent's configuration file so requests route through the model provider service. ucode attaches the Databricks-Model-Provider-Service header to every request. Unity AI Gateway resolves the service, supplies the stored credentials, and forwards the request to the external provider.

Note

--provider is supported for ucode claude and ucode codex. If the model provider service feature is not enabled on your workspace, or you lack EXECUTE on the service, ucode prints a descriptive error.

Step 3 (optional): Configure agents interactively

To select a model provider service through a guided flow instead of passing --provider, run:

ucode configure

For Claude Code and Codex CLI, ucode configure lists the model provider services available to you and enables you to select one. Choosing none routes the agent through Azure Databricks-provided models.

For the full command reference, run ucode --help.

How routing works

When you route an agent through a model provider service, ucode sets the agent's base URL to your Unity AI Gateway endpoint and adds the Databricks-Model-Provider-Service header naming the service:

  • Claude Code authenticates against https://<workspace-url>/ai-gateway/anthropic and carries the header in ANTHROPIC_CUSTOM_HEADERS. For an Amazon Bedrock–backed service, ucode pins the provider-side model IDs (for example, us.anthropic.claude-sonnet-4-6).
  • Codex CLI authenticates against https://<workspace-url>/ai-gateway/codex/v1 with wire_api = "responses" and carries the header in the provider's http_headers.

The model the agent sends must be one the model provider service allows. See Create and manage model provider services for allow_all_targets and targets.

Next steps