Environment: one Azure Databricks workspace, pay-per-token foundation models, Enforce Unity Gateway off, requests sent with curl and a CLI-issued token.
Symptom. A request naming a Unity Catalog model service, system.ai.claude-haiku-4-5, sent to https://<workspace-host>/serving-endpoints/chat/completions returns:
HTTP 404
{"error_code":"ENDPOINT_NOT_FOUND","message":"The given endpoint does not exist, please retry after checking the specified model and version deployment exists."}The same request to https://<workspace-host>/ai-gateway/mlflow/v1/chat/completions returns 200. The legacy endpoint name databricks-claude-haiku-4-5 on /serving-endpoints/chat/completions also returns 200. Embeddings split the same way. system.ai.gte-large-en is a 404 on /serving-endpoints/embeddings and a 200 with 1024 dimensions on /ai-gateway/mlflow/v1/embeddings.
Why it matters. The migration guide (https://learn.microsoft.com/azure/databricks/ai-gateway/migrate-to-unity-gateway) says to change the base URL from /serving-endpoints to /ai-gateway/mlflow/v1 and the model from the endpoint name to the fully qualified model service name, and that legacy configurations stay unchanged until Enforce Unity Gateway is turned on. Our legacy name answering is the sign enforcement was off. The 404 for the catalog name came anyway, so a client that lists system.ai names and sends them down the old path fails before any enforcement decision.
Reproduce it. Replace $HOST and $TOKEN:
BODY='{"model":"MODEL","messages":[{"role":"user","content":"Reply with OK"}],"max_tokens":8}'
for MODEL in system.ai.claude-haiku-4-5 databricks-claude-haiku-4-5; do
for PATH_ in serving-endpoints ai-gateway/mlflow/v1; do
printf '%s on /%s: ' "$MODEL" "$PATH_"
curl -s -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d "${BODY/MODEL/$MODEL}" "$HOST/$PATH_/chat/completions"
done
doneExpected: the system.ai name is 404 on the first path and 200 on the second; the databricks- name is 200 on the first. We did not test the databricks- name on the gateway path or an enforcement-on workspace.
What we changed. Our product stores one URL per Databricks connection, usually the bare workspace host. Switching every bare host to the gateway path was proposed and rejected, because our workspace's custom-named serving endpoint is addressed under /serving-endpoints, the migration guide keeps existing provisioned throughput endpoints in place with a model service referencing them, and model discovery reads GET /api/2.0/serving-endpoints, which has no gateway counterpart. Instead the model name picks the path. For a stored URL with no path or exactly /serving-endpoints, a model id matching ^[^./]+\.[^./]+\.[^./]+$ goes to <origin>/ai-gateway/mlflow/v1 and any other id goes to <origin>/serving-endpoints; a stored URL with any other path is used as typed. Discovery keeps calling the serving-endpoints API with no model name.
Limits. One workspace, one run, enforcement off. A service principal with query rights on a serving endpoint and nothing on the model service may get PERMISSION_DENIED on the gateway path for a three-part name; those calls were 404 before. The embeddings docs page shows the Python SDK passing system.ai.gte-large-en to serving_endpoints.query, which we did not run; our REST call with that name on /serving-endpoints is the one above.
Longer write-up with the routing function: https://www.techfabric.com/blog/unity-catalog-model-names-return-404-on-serving-endpoints