Skip to main content

Adding Models

This section explains the steps to add Databricks models and configure the required access controls.
1

Navigate to Databricks Models in AI Gateway

From the TrueFoundry dashboard, navigate to AI Gateway > Models and select Databricks.
Navigating to Databricks Model Account in AI Gateway

Navigate to Databricks Models

2

Add Databricks Account and Authentication

Give a unique name for the Databricks account. This will be used to refer to the models later. Provide the authentication details for the AI Gateway to access your Databricks models. TrueFoundry supports both Service Principal and Personal Access Token (PAT) based authentication.
Using Service Principal (Recommended):Service Principal authentication is the recommended approach for production environments as it provides better security and access control.
  • Choose Service Principal Auth.
  • Enter your Databricks Service Principal Client ID and OAuth Secret.
Databricks Account Configuration Form with Service Principal Client ID and OAuth Secret Fields

Service Principal Authentication

Using Personal Access Token (PAT):Personal Access Tokens are suitable for development and testing environments.
  • Choose Databricks API Key Based Auth.
  • Enter your PAT.
Databricks Account Configuration Form with PAT Field

Personal Access Token (PAT) Authentication

Finally, enter your Databricks workspace URL (e.g., https://<workspace_id>.cloud.databricks.com).
Enter the workspace URL only — do not append /serving-endpoints or any other path. The AI Gateway adds the correct path for each model and each API.
3

Add Models

Click + Add Model to add a new model configuration. The Model ID must exactly match the name Databricks uses for the model, which depends on how the model is served:Both styles can live in the same model account. The AI Gateway routes on the name itself — a three-part dotted name goes to Databricks’ Unity AI Gateway, anything else to Model Serving — so nothing else needs to be configured.
Databricks serves newer models as model services in Unity Catalog rather than as serving endpoints. To find one:
  1. In your Databricks workspace, click AI Gateway in the left sidebar, or open Catalog Explorer and browse to the schema that holds the model service.
  2. Note its catalog, schema, and name, and join them with dots — that full string is your Model ID. Databricks’ own pay-per-token models live under system.ai (for example, system.ai.claude-sonnet-4-5); models your team creates use your own catalog and schema (for example, my_catalog.my_schema.my_gpt).
The service principal or PAT on your model account needs EXECUTE on the model service, plus USE CATALOG and USE SCHEMA on its catalog and schema. Services in system.ai grant EXECUTE to all account users by default. See Govern model services.
  1. Access Databricks Serving: In your Databricks workspace, navigate to Serving in the left sidebar and click Create serving endpoint.
    Databricks workspace interface showing the Serving option in the left sidebar menu
  2. Configure Endpoint:
    • Endpoint name: Choose a descriptive name. This name will be your Model ID in TrueFoundry.
    • Served Entity: Choose from Foundation Models or your custom models.
    Databricks serving endpoint configuration form with fields for endpoint name and model selection
  3. Deploy and Verify: Click Create and wait for the deployment to become Ready.
Databricks model configuration form in TrueFoundry with display name and model ID fields

Add Databricks Model in TrueFoundry

The two naming styles are not interchangeable — copy the name exactly as Databricks shows it. Calling a model service by an endpoint-style name returns the given endpoint does not exist, and calling a serving endpoint that has moved to Unity Catalog returns 501 ... no longer available. Use Unity Catalog model services.

Inference

After adding the models, you can perform inference using an OpenAI-compatible API via the Playground or by integrating it with your own application.
Code Snippet and Try in Playgroud Buttons for each model

Infer Model in Playground or Get Code Snippet

Requests are OpenAI-compatible for both naming styles, so nothing in your application changes when a model moves from a serving endpoint to a model service. As with every provider, model is <model-account-name>/<display-name> — the Model ID you configured is what the AI Gateway sends to Databricks:
Python
The APIs available to a model depend on how Databricks serves it:

Responses API

Databricks serves the Responses API natively for every Unity Catalog model service, and for its OpenAI foundation model serving endpoints — databricks-gpt-5, databricks-gpt-5-1, databricks-gpt-5-mini, and the rest of the databricks-gpt-5* family. The AI Gateway forwards these requests to Databricks unchanged, so you get back a real Responses object with a resp_ id, including the model’s reasoning output.
Python
Streaming works the same way — set stream=True and iterate over the emitted events.
Every other Databricks serving endpoint still accepts /responses, but the AI Gateway translates the request into a chat completion and converts the reply back. The response id tells you which path a request took: resp_ means it went to Databricks natively, chatcmpl- means it was translated. Reasoning output is not returned on the translated path.This is decided by the serving endpoint name, which is your Model ID in TrueFoundry. A GPT-5 model you deploy behind a custom endpoint name is treated like any other endpoint.
On Unity Catalog model services, /responses is served by the Databricks Supervisor API, which is in Beta behind a workspace preview flag. If your workspace does not have it enabled, chat completions and embeddings still work while /responses fails.
Databricks does not support server-side conversation state on pay-per-token endpoints. previous_response_id, store, and background are passed through to Databricks rather than dropped, so sending them returns an upstream 400 rather than silently losing your conversation history:
To hold a multi-turn conversation, send the full history in input on each turn.

Messages API

Claude Unity Catalog model services are served natively on the Messages API, so you can point the Anthropic SDK at the AI Gateway and get a real Anthropic response back.
Python
Non-Claude model services and all Model Serving endpoints also accept /messages, but the request is translated into a chat completion and converted back. The response id tells you which path a request took: msg_bdrk_ means Databricks served it natively, chatcmpl- means it was translated.