Skip to main content
Databricks is a data and AI platform. Its Unity Gateway governs access to language models through model provider services, and a Custom provider can point at any OpenAI-compatible endpoint. SambaCloud is one, so a Databricks workspace can serve SambaNova models without any partnership or code change. This guide covers two routes: a Unity Gateway provider service that you call from Python, and a Model Serving endpoint that you call from SQL with ai_query.
This guide was tested on a Databricks Free Edition workspace on AWS in November 2026. Databricks marks Model Serving external model endpoints as legacy and points new work to Unity Gateway, so menu names and options can change. Check the Databricks documentation if a screen looks different.

Prerequisites

  • A SambaCloud account and API key
  • A Databricks workspace with AI Gateway (Unity Gateway) in the sidebar and a SQL warehouse
  • A Databricks personal access token. Create one under Settings → User → Developer → Access tokens.
  • Python 3.9 or higher

Create a provider service for SambaCloud

A model provider service stores the SambaCloud endpoint and key. Databricks calls it by its three-part Unity Catalog name, catalog.schema.name.
1

Open the new provider form

In the Databricks sidebar, open AI Gateway, select the Providers tab, and click + Provider.
2

Choose the Custom provider and enter the SambaCloud endpoint

Set Catalog to workspace, Schema to default, and Name to sambanova. Under Provider, select Custom, then fill in:
  • Provider endpoint: https://api.sambanova.ai/v1
  • Auth method: Bearer token, with the type set to Plaintext
  • Bearer token: your SambaCloud API key
3

Register the model with an endpoint route

Under Models, enter these values and click Add model:
  • Model name: MiniMax-M3.1-Flash
  • Provider api types: /openai/v1/chat/completions
  • Endpoint route: chat/completions
Edit model provider service dialog showing MiniMax-M3.1-Flash invoked at https://api.sambanova.ai/v1/chat/completions, the provider endpoint https://api.sambanova.ai/v1, and a stored bearer token
Without the endpoint route, Databricks calls the provider endpoint itself, https://api.sambanova.ai/v1, which is a base URL and not a chat route. Check that the model line reads “Invoked at https://api.sambanova.ai/v1/chat/completions”. See Troubleshooting.
4

Create the service

Click Create. The provider service page lists MiniMax-M3.1-Flash as one available model.
Unity Gateway provider service sambanova with one custom model, MiniMax-M3.1-Flash, and a Get started panel with a cURL request

Call the model from Python

Requests go to your workspace, not to SambaCloud. The Databricks-Model-Provider-Service header names the provider service you created, and the model is the model name you registered.
1

Install the client

This guide was tested with openai 2.48.0 on Python 3.9.
2

Set your workspace URL and token

3

Send a request

query.py
Output
MiniMax-M3.1-Flash is a reasoning model, so it thinks before it answers. Requests in this test took about 4 to 11 seconds end to end. The Databricks Get started panel on the provider service page also shows a ready-made request for your own workspace.

Use the model in SQL with ai_query

ai_query calls a Model Serving endpoint by name. In the workspace used for this guide, ai_query did not accept the Unity Gateway provider service: SELECT ai_query('workspace.default.sambanova', ...) failed with “ai_query through UC Model Services is not enabled”. To call SambaCloud from SQL, create a Model Serving endpoint with a custom provider.
1

Create the serving endpoint

In the sidebar, open Serving and click Create serving endpoint. Set Name to sambanova-minimax. Click the Entity field, select Foundation models, choose Custom Provider from the list, and click Confirm. When Databricks suggests Unity Gateway, click Continue creating in Serving, then fill in:
  • Custom Provider Model URL: https://api.sambanova.ai/v1/chat/completions
  • Custom Provider Authentication Type: Bearer Token Authentication, with the type set to Plaintext
  • Bearer Token: your SambaCloud API key
  • Model Name: MiniMax-M3.1-Flash
  • Task: Chat
Here the URL must be the full path. This form has no separate endpoint route.
2

Wait for the endpoint to be ready

Click Create. The endpoint page shows Ready when the endpoint can take requests.
Serving endpoint sambanova-minimax in the Ready state with a Custom Provider pointing to https://api.sambanova.ai/v1/chat/completions
3

Query it from the SQL editor

Open the SQL Editor, attach the serverless starter warehouse, and run:
The first run can take longer while the warehouse starts. The query in this test finished in about 5 seconds once the warehouse was running.
SQL editor result of ai_query against sambanova-minimax, returning a MiniMax-M3.1-Flash answer in one row

Troubleshooting

The provider service has no endpoint route, so Databricks posts to https://api.sambanova.ai/v1 itself. Edit the provider service, remove the model, add it again with the route chat/completions, and save. The model line must read “Invoked at https://api.sambanova.ai/v1/chat/completions”.
A value starting with dapi is a Databricks token, so the provider service holds a Databricks token instead of your SambaCloud key. Edit the provider service and paste your SambaCloud key into Bearer token, then save. If you leave that field blank, Databricks keeps the credential it already stores.
You passed the name of a Unity Gateway provider service to ai_query. Pass the name of a Model Serving endpoint instead, as described in Use the model in SQL with ai_query.

Additional resources