Understanding and controlling costs of Snowflake AI from Cortex AI Inference & Search, through to experimental development, retries and out-of-control workloads.
Snowflake AI brings a new complexity to managing costs.
Snowflake has traditionally been optimized around warehouse sizes, query performance, auto suspend, storage and pipeline costs. With AI workloads there are some new complexities.
An application request could contain many elements including, LLM inference, document fetch, multiple SQL queries and multiple model evaluations. During experimentation a developer could make many AI requests, often without knowing they have created dozens of AI requests.
The main issue with Snowflake AI is that it is a credit intensive process and can be a bit of a stealth cost. This makes it hard to track with traditional dashboards.
In this article I will discuss:
Depending on the feature, deployment type and pricing, there can be a number of costs associated with your AI workloads.
Not all AI costs will be warehouse related. There may be multiple costing elements including AI service usage, warehouse compute and additional service costs. Before you start calculating any costs, please check your current pricing documentation for your region, cloud and contract. The credit rate and metering will depend on the feature.
A good FinOps architecture for AI will allow you to understand where costs are being used, who is using them (project/developer), identify anomalies and allow for the correct remediation.
Reference Architecture for AI Consumption Monitoring, Attribution, Anomaly Detection and Remediation.
It is important to ensure that your detection and remediation are separated. When you identify an anomaly you should investigate. If you want to automatically cancel production AI workloads you need a higher level of protection.
The queries below utilizeSnowflake Account Usage views. They are a good starting point for building your operational cost monitoring tool.
SELECT USAGE_DATE, SERVICE_TYPE, SUM(CREDITS_USED) AS CREDITS_USEDFROM SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORYWHERE USAGE_DATE >= DATEADD(DAY, -30, CURRENT_DATE()) AND ( SERVICE_TYPE ILIKE '%AI%' OR SERVICE_TYPE ILIKE '%CORTEX%' OR SERVICE_TYPE ILIKE '%COCO%' )GROUP BY 1, 2ORDER BY USAGE_DATE DESC, CREDITS_USED DESC;
This provides a high-level breakdown of metered AI-related services. Treat the service-name filter as a discovery query, not a complete billing reconciliation: confirm the service types in your account against Snowflake’s current metering documentation.
SELECT FUNCTION_NAME, MODEL_NAME, COUNT(DISTINCT QUERY_ID) AS QUERY_COUNT, ROUND(SUM(CREDITS), 4) AS AI_CREDITSFROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORYWHERE START_TIME >= DATEADD(DAY, -7, CURRENT_TIMESTAMP())GROUP BY 1, 2ORDER BY AI_CREDITS DESC;
This helps identify which functions and models consume the most AI credits. The view records AI-function credits separately from warehouse credits, and long-running queries can have multiple hourly records.
SELECT QUERY_ID, MODEL_NAME, FUNCTION_NAME, MIN(START_TIME) AS FIRST_SEEN, MAX(END_TIME) AS LAST_SEEN, SUM(CREDITS) AS AI_CREDITSFROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORYWHERE START_TIME >= DATEADD(DAY, -7, CURRENT_TIMESTAMP())GROUP BY 1, 2, 3ORDER BY AI_CREDITS DESCLIMIT 25;
This is particularly useful for finding bulk AI processing queries that invoke a model across many records.
SELECT DATABASE_NAME, SCHEMA_NAME, SERVICE_NAME, CONSUMPTION_TYPE, ROUND(SUM(CREDITS), 4) AS CREDITSFROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_SEARCH_DAILY_USAGE_HISTORYWHERE USAGE_DATE >= DATEADD(DAY, -30, CURRENT_DATE())GROUP BY 1, 2, 3, 4ORDER BY CREDITS DESC;
The consumption categories distinguish serving, embedding, and batch usage. When combining this view with AI Functions usage, avoid double-counting embedding credits.
First, assign meaningful query tags in your development sessions:
ALTER SESSION SET QUERY_TAG = 'project=ai_cost_monitor;env=dev;team=data_engineering';
Then investigate the most expensive AI queries alongside query history:
WITH AI_COST AS ( SELECT QUERY_ID, SUM(CREDITS) AS AI_CREDITS FROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORY WHERE START_TIME >= DATEADD(DAY, -7, CURRENT_TIMESTAMP()) GROUP BY QUERY_ID)SELECT Q.USER_NAME, Q.QUERY_TAG, COUNT(*) AS QUERY_COUNT, ROUND(SUM(A.AI_CREDITS), 4) AS AI_CREDITSFROM AI_COST AJOIN SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY Q ON A.QUERY_ID = Q.QUERY_IDGROUP BY 1, 2ORDER BY AI_CREDITS DESC;
This attributes AI-function spending to the SQL user and query tag where query-history records are available. It does not necessarily identify the end user behind a shared service account.
An effective monitoring system should distinguish a normal increase in usage from an abnormal one.
For example, suppose your development environment usually consumes 10 AI credits daily, but suddenly consumes 80.
Illustrative AI credit consumption
Friday’s eightfold increase deserves investigation, but is not automatically evidence of waste.
A simple first step is to compare today’s usage with the previous seven days.
WITH DAILY AS ( SELECT USAGE_DATE, SUM(CREDITS_USED) AS CREDITS FROM SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORY WHERE SERVICE_TYPE = 'AI_FUNCTIONS' AND USAGE_DATE >= DATEADD(DAY, -8, CURRENT_DATE()) GROUP BY 1),BASELINE AS ( SELECT AVG(CREDITS) AS AVG_CREDITS FROM DAILY WHERE USAGE_DATE BETWEEN DATEADD(DAY, -7, CURRENT_DATE()) AND DATEADD(DAY, -1, CURRENT_DATE()))SELECT D.USAGE_DATE, D.CREDITS, B.AVG_CREDITS, ROUND(D.CREDITS / NULLIF(B.AVG_CREDITS, 0), 2) AS BASELINE_MULTIPLIERFROM DAILY DCROSS JOIN BASELINE BWHERE D.USAGE_DATE = CURRENT_DATE();
This example monitors the AI_FUNCTIONS service type. For a complete AI budget, reconcile all applicable AI service types rather than relying on a single category. Daily metering may also be delayed, so use the appropriate feature-specific views for more timely detection.
Development is one of the easiest places to accumulate AI spending without noticing it.
Consider a developer building a product-review classification pipeline.
The initial experiment processes 100 customer reviews. Everything works, so the developer runs the same logic against 100,000 records.
But the SQL query invokes an AI function once per row.
The result is potentially 100,000 model evaluations from a single SQL statement.
Here are common development scenarios that create unexpected costs.
SELECT REVIEW_ID, AI_SENTIMENT(REVIEW_TEXT) AS SENTIMENTFROM CUSTOMER_REVIEWS;
This is straightforward SQL, but processing a large table can generate substantial AI usage.
A safer development approach:
SELECT REVIEW_ID, AI_SENTIMENT(REVIEW_TEXT) AS SENTIMENTFROM CUSTOMER_REVIEWSWHERE REVIEW_TEXT IS NOT NULLORDER BY REVIEW_IDLIMIT 100;
The second query limits the input to 100 records. It is useful for controlled experimentation, although you should not assume that adding LIMIT to every SQL shape guarantees a corresponding reduction in AI evaluations. For expensive workloads, explicitly materialize the sample before invoking AI.
CREATE OR REPLACE TEMP TABLE REVIEW_SAMPLE ASSELECT REVIEW_ID, REVIEW_TEXTFROM CUSTOMER_REVIEWSWHERE REVIEW_TEXT IS NOT NULLORDER BY REVIEW_IDLIMIT 100;
SELECT REVIEW_ID, AI_SENTIMENT(REVIEW_TEXT) AS SENTIMENTFROM REVIEW_SAMPLE;
This creates a bounded input dataset before inference begins.
I recommend a five-layer approach.
Snowflake now documents AI-specific resource and shared budgets, as well as per-user quotas for supported features. Budget actions are periodic rather than instantaneous; quotas can block additional requests more quickly.
For an organization introducing Snowflake AI, I would start with these policies:
These controls should be applied based on workload criticality. A research experiment and a customer-facing production application should not have identical enforcement rules.
One of the most useful metrics is not simply total credits.
It is cost per successful business outcome.
For example, suppose a document classification application consumes 120 credits to process 40,000 documents, of which 36,000 are successfully classified.
These are illustrative calculations, not observed Snowflake performance.
An optimization that reduces total credits but significantly increases classification errors may actually worsen business economics.
Track inference cost alongside accuracy, latency, retries, and successful outcomes.
A practical Snowflake AI FinOps rollout can be organized into four phases.
As Snowflake AI adoption grows, cost optimization must extend beyond warehouse sizing and query tuning.
AI workloads introduce new consumption patterns: token processing, document extraction, search serving, multi-step agent execution, and repeated development experimentation.
The most effective approach is to establish visibility first, identify which workloads drive spending, then introduce controls that preserve useful AI capabilities without allowing uncontrolled consumption.
The objective is not to minimize every AI credit. It is to ensure that every AI workload delivers measurable value at a predictable cost.
The question data engineering teams should ask is no longer just, “How much did Snowflake cost?” It is, “Which AI workloads created that cost, why did they consume those resources, and what value did we receive?”
Snowflake AI Cost Optimization: Where the Spend Comes From, How to Detect It, and How to Control It was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.