billable_usage
Creates, updates, deletes, gets or lists a billable_usage resource.
Overview​
| Name | billable_usage |
| Type | Resource |
| Id | databricks_account.billing.billable_usage |
Fields​
The following fields are returned by SELECT queries:
- billable_usage_download
| Name | Datatype | Description |
|---|---|---|
contents | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
billable_usage_download | select | account_id, start_month, end_month, account_host | personal_data | Returns billable usage logs in CSV format for the specified account and date range. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_host | string | The Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}}) |
account_id | string | |
end_month | string | Format: YYYY-MM. Last month to return billable usage logs for. This field is required. |
start_month | string | Format specification for month in the format YYYY-MM. This is used to specify billable usage start_month and end_month properties. Note: Billable usage logs are unavailable before March 2019 (2019-03). |
personal_data | boolean | Specify whether to include personally identifiable information in the billable usage logs, for example the email addresses of cluster creators. Handle this information with care. Defaults to false. |
SELECT examples​
- billable_usage_download
- Export to CSV
Returns billable usage logs in CSV format for the specified account and date range.
SELECT
contents
FROM databricks_account.billing.billable_usage
WHERE account_id = '{{ account_id }}' -- required
AND start_month = '{{ start_month }}' -- required
AND end_month = '{{ end_month }}' -- required
AND account_host = '{{ account_host }}' -- required
AND personal_data = '{{ personal_data }}'
;
Export billable usage data to a local CSV file using the StackQL CLI:
./stackql exec \
-o text \
--hideheaders \
-f billable_usage.csv \
"SELECT contents
FROM databricks_account.billing.billable_usage
WHERE start_month = '2025-12'
AND end_month = '2026-01'
AND account_id = 'your-account-id'"
This downloads the usage data in CSV format directly from the Databricks API.