Query Foundation Model Endpoints
Query Databricks foundation-model endpoints for production-ready access to hosted models with built-in AI Gateway governance.

Build with AI
- Copy the prompt below
- Paste into Cursor, Claude Code, Codex, or any coding agent
- Your agent builds it — asking questions along the way so the result is exactly what you want
New to templates? Learn more here
When done, you will have:
- A configured foundation-model serving endpoint for chat inference in your app
- A query helper using the Databricks SDK for standard request/response interactions
- An optional streaming setup using the Vercel AI SDK for real-time chat responses
Prerequisites
Verify these Databricks workspace features are enabled before starting. If any check fails, ask your workspace admin to enable the feature.
- Foundation Model API endpoints with AI Gateway governance. Databricks-hosted foundation-model endpoints come preconfigured with AI Gateway features (usage tracking, rate limits, guardrails). Confirm availability by listing endpoints and checking the config:
databricks serving-endpoints list --profile <PROFILE>should return at least onedatabricks-*foundation-model endpoint, anddatabricks serving-endpoints get <endpoint-name> --profile <PROFILE> -o json | grep -q '"ai_gateway"' && echo okshould printok. Endpoint availability varies by workspace and region.


