Pay-i Integration for Databricks

Pay-i tracks cost and usage data from your Databricks inference calls without requiring changes to your existing application code—beyond a one-time instrumentation setup.

Once configured, every request your application sends to Databricks Model Serving flows through Pay-i. Token counts, model attribution, and cost are captured automatically and appear in your Application dashboard.

How it works

Databricks routes inference traffic through workspace-specific URLs rather than a single global endpoint. Pay-i uses host mappings to associate traffic from your Databricks workspace with a Category in your Pay-i Application. You configure this mapping once at startup via payi_instrument()—from that point on, Pay-i captures usage automatically with no per-request changes.

Supported client patterns

Pay-i instruments the following Databricks client patterns. All use the same host_mappings configuration.

ClientPackageWhen to use
Standard OpenAI clientopenaiOutside Databricks; explicit auth via WorkspaceClient
Databricks OpenAI clientdatabricks-openaiInside Databricks notebooks or jobs; auth resolves from the environment

If you're using the Databricks SDK directly via workspace.serving_endpoints.query(), see Manual Event Submission for that path.

Supported hyperscalers

Pay-i supports Databricks deployments on all three major clouds. Your full category name includes your cloud:

CloudCategory
Amazon Web Services (AWS)system.databricks.aws
Microsoft Azuresystem.databricks.azure
Google Cloud Platform (GCP)system.databricks.google

In code examples throughout these docs, system.databricks is used as shorthand. Substitute your cloud-specific value where applicable—see Instrumenting Databricks for details.

All product names, logos, and trademarks referenced in this documentation are the property of their respective owners.