<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Documentation on all ways to access agent serving endpoint from outside databricks in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141441#M1511</link>
    <description>&lt;P&gt;Struggling to find clear documentation which can help me with the subject. Need to know all the ways (production best practices) along with API method. As far as I know, using PAT is not a production best practice&lt;/P&gt;</description>
    <pubDate>Mon, 08 Dec 2025 18:36:11 GMT</pubDate>
    <dc:creator>actualhuman_012</dc:creator>
    <dc:date>2025-12-08T18:36:11Z</dc:date>
    <item>
      <title>Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141441#M1511</link>
      <description>&lt;P&gt;Struggling to find clear documentation which can help me with the subject. Need to know all the ways (production best practices) along with API method. As far as I know, using PAT is not a production best practice&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 18:36:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141441#M1511</guid>
      <dc:creator>actualhuman_012</dc:creator>
      <dc:date>2025-12-08T18:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141820#M1524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/160119"&gt;@actualhuman_012&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You’re absolutely right that &lt;STRONG&gt;Personal Access Tokens (PATs) are not considered a production best practice&lt;/STRONG&gt;. For accessing &lt;STRONG&gt;Agent / Model Serving endpoints from outside Databricks&lt;/STRONG&gt;, the recommended and supported approach for production is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Service Principal authentication (OAuth-based)&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a Service Principal&lt;/LI&gt;&lt;LI&gt;Grant it permissions on the serving endpoint&lt;/LI&gt;&lt;LI&gt;Authenticate using short-lived OAuth tokens&lt;/LI&gt;&lt;LI&gt;Call the Databricks Serving REST API from external systems&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This approach provides proper security, token rotation, and governance, and is suitable for production workloads, CI/CD pipelines, and external applications.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PATs&lt;/STRONG&gt; should be limited to development or proof-of-concept use cases only.&lt;/P&gt;&lt;P&gt;Optionally, for more enterprise-grade setups, an &lt;STRONG&gt;AI Gateway&lt;/STRONG&gt; can be used in front of the serving endpoint to centralize authentication, rate limiting, and observability.&lt;/P&gt;&lt;P&gt;Hope this helps clarify the recommended production setup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gema.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Dec 2025 16:31:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141820#M1524</guid>
      <dc:creator>Gecofer</dc:creator>
      <dc:date>2025-12-14T16:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141838#M1525</link>
      <description>&lt;P&gt;Hi Gecofer/Gema,&lt;/P&gt;&lt;P&gt;I was looking for the documentation which actually details the code examples to do so, but not really able to find it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2025 06:44:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/141838#M1525</guid>
      <dc:creator>actualhuman_012</dc:creator>
      <dc:date>2025-12-15T06:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/142926#M1550</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/160119"&gt;@actualhuman_012&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These official Databricks links should help, as they cover the production-recommended way (Service Principal) and the Serving Endpoint API with examples:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Service Principal authentication&lt;/STRONG&gt;&lt;BR /&gt;&lt;A target="_new" rel="noopener"&gt;https://docs.databricks.com/en/dev-tools/auth/service-principals.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Serving Endpoints REST API (Agent / Model Serving)&lt;/STRONG&gt;&lt;BR /&gt;&lt;A class="" href="https://docs.databricks.com/api/workspace/servingendpoints" target="_new" rel="noopener"&gt;https://docs.databricks.com/api/workspace/servingendpoints&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this documentation helps.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jan 2026 16:45:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/142926#M1550</guid>
      <dc:creator>Gecofer</dc:creator>
      <dc:date>2026-01-04T16:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/143030#M1551</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To access an Agent serving endpoint without a Personal Access Token (PAT), you must use &lt;/SPAN&gt;&lt;STRONG&gt;OAuth 2.0 Machine-to-Machine (M2M)&lt;/STRONG&gt;&lt;SPAN&gt; authentication. This is the industry-standard approach for production applications.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;1. OAuth M2M Authentication Workflow&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;Instead of a long-lived PAT, you use a &lt;STRONG&gt;Service Principal&lt;/STRONG&gt; (an identity for your app) and a &lt;STRONG&gt;Client Secret&lt;/STRONG&gt; to request short-lived (1-hour) access tokens.&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;Setup Steps&lt;/STRONG&gt;&lt;/P&gt;&lt;OL class=""&gt;&lt;LI&gt;&lt;STRONG&gt;Create a Service Principal:&lt;/STRONG&gt; In your Databricks workspace, go to &lt;STRONG&gt;Settings &amp;gt; User Management &amp;gt; Service Principals&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Generate a Secret:&lt;/STRONG&gt; Select the service principal, go to the &lt;STRONG&gt;Secrets&lt;/STRONG&gt; tab, and click &lt;STRONG&gt;Generate secret&lt;/STRONG&gt;. Save the Client ID and Client Secret.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Assign Permissions:&lt;/STRONG&gt; Go to the &lt;STRONG&gt;Serving&lt;/STRONG&gt; tab, select your agent endpoint, and under &lt;STRONG&gt;Permissions&lt;/STRONG&gt;, grant your Service Principal &lt;STRONG&gt;Can Query&lt;/STRONG&gt; permissions.&lt;/LI&gt;&lt;/OL&gt;&lt;P class=""&gt;&lt;STRONG&gt;2. Access via Python (Databricks SDK)&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;The Databricks SDK handles the token lifecycle (fetching and refreshing) automatically if you provide the credentials.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
from databricks.sdk import WorkspaceClient

# Credentials should be stored in environment variables for security
w = WorkspaceClient(
    host="https://&amp;lt;workspace-instance-name&amp;gt;.cloud.databricks.com",
    client_id=os.environ.get("DATABRICKS_CLIENT_ID"),
    client_secret=os.environ.get("DATABRICKS_CLIENT_SECRET")
)

# Querying the agent endpoint
response = w.serving_endpoints.query(
    name="my-agent-endpoint",
    messages=[{"role": "user", "content": "How do I use this agent?"}]
)

print(response.choices[0].message.content)&lt;/LI-CODE&gt;&lt;P class=""&gt;&lt;STRONG&gt;3. Access via REST API &lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;If you aren't using the Python SDK, you must manually fetch the token first.&lt;/P&gt;&lt;P class=""&gt;Step 1: Fetch the OAuth Token&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Token URL format: https://&amp;lt;workspace-instance&amp;gt;/oidc/v1/token
curl -X POST "https://&amp;lt;workspace-instance&amp;gt;.cloud.databricks.com/oidc/v1/token" \
     -u "$CLIENT_ID:$CLIENT_SECRET" \
     -d "grant_type=client_credentials&amp;amp;scope=all-apis"&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Step 2: Query the Agent Endpoint&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;curl -X POST "https://&amp;lt;workspace-instance&amp;gt;.cloud.databricks.com/serving-endpoints/my-agent-endpoint/invocations" \
     -H "Authorization: Bearer &amp;lt;access_token_from_step_1&amp;gt;" \
     -H "Content-Type: application/json" \
     -d '{"messages": [{"role": "user", "content": "Hello agent!"}]}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Documentation Links&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;OAuth M2M Authentication:&lt;/STRONG&gt; &lt;A class="" href="https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html" target="_blank" rel="noopener"&gt;Databricks OAuth M2M Docs&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Agent Serving API Reference:&lt;/STRONG&gt; &lt;A class="" href="https://docs.databricks.com/api/workspace/servingendpoints" target="_blank" rel="noopener"&gt;Serving Endpoints API&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Databricks Python SDK:&lt;/STRONG&gt; &lt;A class="" href="https://www.google.com/search?q=https://github.com/databricks/databricks-sdk-python" target="_blank" rel="noopener"&gt;Python SDK GitHub/Docs&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Permissions Management:&lt;/STRONG&gt; &lt;A class="" href="https://www.google.com/search?q=https://docs.databricks.com/en/machine-learning/model-serving/manage-serving-endpoints.html%23manage-permissions-on-a-model-serving-endpoint" target="_blank" rel="noopener"&gt;Manage Serving Endpoint Permissions&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 05 Jan 2026 14:44:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/143030#M1551</guid>
      <dc:creator>nayan_wylde</dc:creator>
      <dc:date>2026-01-05T14:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Documentation on all ways to access agent serving endpoint from outside databricks</title>
      <link>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/144964#M1577</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/79394"&gt;@nayan_wylde&lt;/a&gt;&amp;nbsp;. This is what I needed.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2026 06:12:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/documentation-on-all-ways-to-access-agent-serving-endpoint-from/m-p/144964#M1577</guid>
      <dc:creator>actualhuman_012</dc:creator>
      <dc:date>2026-01-23T06:12:22Z</dc:date>
    </item>
  </channel>
</rss>

