src/invoke
Calling a Model Serving endpoint directly over HTTP.
The SDK’s servingEndpoints.query covers the typed request shapes, but an
OpenAI-compatible caller (a proxy, a passthrough route, a streaming client)
needs to issue its own fetch against Databricks’ OpenAI-shaped URLs with
an OpenAI body. That needs exactly two things the SDK doesn’t hand out
directly: the URL (invocationsUrl / responsesUrl /
openResponsesUrl) and a currently-valid set of auth headers
(authHeaders).
Auth is delegated entirely to the Databricks SDK: config.authenticate
re-runs the configured credential provider on every call and refreshes the
underlying OAuth / PAT token when it is close to expiry, so a caller never
manages token lifetimes itself - mint headers per request and each one is
signed with a valid bearer token.
Interfaces
Section titled “Interfaces”Variables
Section titled “Variables”- AI_GATEWAY_CODEX_RESPONSES_PATH
- ANTHROPIC_BASE_PATH
- ANTHROPIC_MESSAGES_PATH
- CHAT_COMPLETIONS_PATH
- INVOCATIONS_SUFFIX
- OPEN_RESPONSES_PATH
- RESPONSES_PATH
- SERVING_ENDPOINTS_PATH