How Do You Monitor and Cap Snowflake Cortex AI Credit Costs?
Cortex AI spend is metered apart from your warehouses, so it needs its own measurement, alerts and cap
You monitor Snowflake Cortex AI credits by querying the Account Usage views that meter AI functions, and you cap them with controls you assemble yourself, because Snowflake budgets alert but do not stop spend. Per the Snowflake AI function cost documentation, Cortex AI functions "incur compute cost based on the number of tokens processed", and the usage lands in CORTEX_FUNCTIONS_USAGE_HISTORY and CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY. That is a different meter from your warehouse credits, so a resource monitor on a warehouse will not see most of it.
Key Takeaways
- •Cortex AI functions are billed in credits per million tokens, and for text-generating functions both input and output tokens are billable, so cost scales with prompt size and not with query runtime.
- •CORTEX_FUNCTIONS_USAGE_HISTORY gives credits and tokens per function call, and CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY gives them per query, which is enough to attribute spend to a user, role or model.
- •Snowflake budgets can cover AI services, but a budget's limit is "used for alerting and notification purposes only", so it is an alarm and not a cap.
- •A real cap is something you build: a scheduled check against the usage views that revokes access or alerts a human when a threshold is crossed.
- •Warehouse costs still apply when a query calls a Cortex LLM function, so you track two meters for one query.
Why Cortex spend does not show up where you are looking
Most cost routines start from the warehouse: size, auto-suspend, queue time, idle credits. A 2026 Snowflake cost guide makes the point that Cortex serverless credits are billed separately from warehouses, and that agents can consume thousands of tokens per prompt. Both facts matter. A team can have a perfectly tuned warehouse fleet and still see the monthly bill rise because an analyst or an agent is calling an LLM function over a large table.
The billing unit is the reason. A warehouse bills for time it is running. A Cortex function bills for tokens it processes. The Snowflake docs note that a token is roughly four characters of text, though it varies by model, that each document page in AI_EXTRACT counts as 970 tokens, and that audio is billed at 50 tokens per second. One careless query over a long text column can therefore cost more than a day of the warehouse that ran it.
That is the new question for anyone running agents against Snowflake. An agent that loops, retries or fans out a prompt over every row multiplies token use without any change in warehouse size. The five steps below separate the problem into measuring, attributing, alerting, capping and reviewing, so each control has one job.
Step 1: Measure AI credits as their own line
Start with the account-level view. The Snowflake docs show an example that filters the metering history on SERVICE_TYPE = 'AI_SERVICES', and name the view METERING_DAILY_HISTORY in that query. Run it daily and chart it next to warehouse credits. The goal at this step is only to learn whether AI spend is a rounding error or a real line item, and how fast it is moving.
Then drill down with the two Cortex-specific views. CORTEX_FUNCTIONS_USAGE_HISTORY reports credits and tokens for each AI function call. CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY reports credits and tokens per query, grouped by model. Per-model grouping is the useful cut, because the same task can run on a small model or a large one at very different token rates.
One caveat from the same page: the docs give no retention period or latency figure for these views, and the per-token credit rates live in Snowflake's external Service Consumption Table. Pull the rate for each model you use from there, store it, and do not hard-code numbers you remember from a blog post.
Step 2: Attribute spend to a user, role and query
A total is not actionable. You need to know who or what caused it. Join the per-query usage view to query history on the query ID, then group by user, role and warehouse. For agent traffic, give each agent its own service user and role so that an agent's spend is a single row in the result and not a mix with human analysts.
This is also where you separate two costs that arrive together. The Snowflake docs state that warehouse costs still apply when a query calls a Cortex LLM function, and recommend a warehouse no larger than MEDIUM for these workloads. Report token credits and warehouse credits side by side per query, so you can see when an oversized warehouse is paying for nothing while the model does the work.
If you already ask questions like "How much are we spending on Snowflake this month?" in your editor, this is the same question with a new filter. The Cost Agent answers it from these usage views and chains with the observability and usage agents to show which pipeline or user drove the change.
Step 3: Alert early with budgets
Snowflake budgets are the native alerting layer. The budgets documentation describes an account budget as a monthly spending limit on compute costs, counted from 12:00 AM UTC on the first day of the calendar month, and says serverless and AI services are supported, including AI_INFERENCE and AI_SERVICES. A custom budget lets you scope the alert to the objects you choose, and an account can hold a maximum of 100 custom budgets.
Two details decide how you use them. First, the default refresh interval is up to 6.5 hours, and the one-hour option raises the budget's own compute cost by a factor of 12. A runaway query can burn through credits well inside that window. Second, the limit is expressed in credits and is "used for alerting and notification purposes only". Budgets notify by email, a cloud queue or a webhook. They do not cancel or block anything.
So treat a budget as the slow, reliable alarm: it tells you the month is on track to exceed the limit. Do not rely on it to protect you from a single expensive afternoon. That job belongs to the next step.
Step 4: Build the cap yourself
Because nothing in the budgets page stops spend, a cap is a control you write. The pattern is a scheduled task that reads the per-user or per-role credit total from the usage views for a rolling window, compares it with a limit you chose per role, and acts when it is exceeded. The mildest action is a notification. The firmer action is revoking the role's access to Cortex functions until a human re-enables it.
Keep the limits per role and per purpose, not one number for the account. An agent that summarizes support tickets and an analyst who classifies free-text survey answers have different normal levels. Start each limit from a week of observed use in Step 2, set it above the typical day, and review it monthly. A cap that fires constantly gets disabled, and a cap that never fires protects nothing.
Resource monitors remain useful, but for the other meter. The Snowflake cost controls documentation says resource monitors "set limits on credits consumed by a warehouse" and can notify or suspend it. Use them to bound the warehouse side of a Cortex query, and use your own task to bound the token side.
Step 5: Review, and hand the routine to an agent
Once measurement, attribution, alerts and a cap exist, the remaining work is repetitive: read the daily numbers, find the user or agent that moved, decide whether the change is intended, and adjust a limit. That is a good job for an agent with read access to the usage views and a human approval step for anything that changes access.
Every Data Workers agent is an MCP server, so you can ask from Claude Code or Cursor: "Which role used the most Cortex credits this week, and which model?" The Model Context Protocol specification defines how a client discovers and calls those tools, which keeps the same question available in whichever editor your team uses. The open-source edition is read-only by default, so it can report and recommend without changing grants. Writes such as revoking a role sit behind approval workflows in Pro.
Pair this with the weekly insights Snowflake already produces. The cost insights documentation states that insights are "calculated and refreshed weekly", and flags warehouses idle for more than 50% of the time they are active. Those cover the warehouse side. The steps above cover the AI side that those insights do not.
Frequently Asked Questions
Are Cortex AI credits included in my warehouse spend?
No. Cortex AI functions are billed by tokens processed, in credits per million tokens, and that usage is metered separately from warehouse runtime. A query that calls an LLM function also incurs normal warehouse cost, so one query produces two charges. Track both, and attribute them together by query ID so you can tell which part of a bill came from the model and which from compute.
Can a Snowflake budget stop Cortex spending at a limit?
No. Per the budgets documentation, a budget's spending limit is used for alerting and notification purposes only. It can warn you when spend is on track to exceed the limit, through email, a cloud queue or a webhook, but it does not cancel queries or revoke access. If you need a hard stop, build it with a scheduled task over the usage views, as in Step 4.
Which views should I query first?
Start with METERING_DAILY_HISTORY filtered to the AI services type for the account total, then CORTEX_FUNCTIONS_USAGE_HISTORY for credits and tokens per function call, and CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY for credits and tokens per query grouped by model. Join the per-query view to query history to get user and role.
How often should the cap check run?
More often than a budget refreshes. The default budget refresh is up to 6.5 hours, so a task that runs hourly, or more often on agent roles, closes the gap. Balance frequency against the cost of the task itself, since a check that is too heavy defeats its purpose.