Snowflake AI spend template

View as Markdown

You can use the Snowflake AI spend template to monitor your organization’s Snowflake Cortex AI Functions spend and usage. Review an executive cost overview, including per-warehouse, per-user, and per-department attribution.

The template is set up with sample data, so you can explore the analysis before you connect your own data.

This template tracks Snowflake Cortex AI Functions usage. To analyze general Snowflake warehouse, cost, and performance data, see Snowflake usage templates.

System and user requirements

The ability to use the Snowflake AI spend template requires the following:

  • You must be assigned an account type with the Create, edit, and publish workbooks permission enabled.
  • To use your own data, your organization must be connected to a data platform containing your Snowflake Cortex AI Functions usage tables (see Data sources). Otherwise, you can use the template with the provided sample data.
  • To attribute spend to people and departments, you must supply a users table that maps each user hash to a person and department.

Data sources

The template expects your organization’s Snowflake Cortex AI Functions usage from ACCOUNT_USAGE tables. The template uses sample tables in the Sigma Sample Connection, but you can change the source to your organization’s own data if it exists in your data platform.

The Snowflake AI spend template expects the data in the following structure:

TableDetails
CORTEX_AI_FUNCTIONS_USAGEOne row per completed Cortex function call — credits, token counts (inside the METRICS object), function name, model name, warehouse, USER_ID_HASH, and start time. Used for every spend, token, model, function, warehouse, and user view.
CORTEX_METERING_DAILYAccount-level daily credits by service type. Used for the AI credits versus total account credits comparison.
Your users tableJoins to the Cortex AI Functions usage on USER_ID_HASH to attribute spend to people and departments. Replaces the sample users table.1

1Snowflake does not identify users or provide department data. Cortex AI Functions usage identifies each user only by a privacy-preserving USER_ID_HASH. By default, spend can only be attributed to specific warehouses. To attribute spend to people and departments, replace the sample users table with your own users table that contains the same one-way hash that Snowflake uses. You can change the source to your table, or load your users into an input table with the same shape, keeping the column names identical so the join and elements continue to work.

Cortex bills in credits, not dollars. The workbook converts credits to USD by multiplying by a credit price — default $2.00 (global routing) or $2.20 (regional). Set the Credit price (USD / AI Credit) filter to your organization’s contracted rate, and confirm your routing before treating the dollar figures as authoritative.

Create a workbook from the template

To create a workbook from this template:

  1. Go to Home > Templates, then select the Snowflake AI Spend template to review its details.

  2. Click Use template. The template opens as an exploration named after the template using sample data.

  3. To use your own data, click Change sources:

    In the Swap data sources overview modal, Sigma attempts to match each source to your own tables. Because the column names match your Cortex AI Functions usage tables, most sources match automatically.

    1. To replace a matched source, select the source drop-down menu, then select a new source.
    2. Match the sample users table to your own users table.
    3. Click Swap now, then explore the changes to confirm your data looks correct.
  4. In the Filters menu, set the Credit price (USD / AI Credit) to your contracted rate and the Date Range to the period you care about.

  5. To create an editable, publishable document, in the document header, click Save as, then name and save the workbook.

If token figures show 0 after you swap in your own data, the key casing in your source differs from the template source and you need to adjust the extraction formula used for the METRICS variant object.

For more details, see Create documents from templates.

About this template

The template contains Executive overview and Users & warehouses pages, plus a hidden Data page for source data. The template also includes a README file to document the purpose of the template, source tables, and setup steps.

Executive overview

This page answers “How much is Snowflake Cortex AI Functions costing us?” and includes:

  • Monthly Spend, Monthly AI Tokens, and Cost per user KPIs, each with the period-over-period change
  • A stacked bar chart of monthly spend by department
  • Top 5 Warehouses by Spend, with a Show control for the number of results and a Spend By control to break spend down by warehouse, model, function, or department
  • AI credits over time, an area chart of AI credit consumption
  • Token Mix By Model, an area chart of AI token consumption across models over time

Users & warehouses

This page answers “Which warehouses drive Snowflake AI spend?” and includes:

  • AI credits vs total account credits, a line chart comparing AI-service credits to total account credits over time
  • Spend by warehouse and Spend by user bar charts
  • User Details, a table of daily cost, credits, tokens, function cost, and model cost by user