Your AI SQL Bill Can Vary 40x by Model, Not Warehouse

Classifying 10M rows in SQL costs $450 to $575 on a small model and up to $21,600 on a frontier one. Model choice moves the bill 40x, the warehouse under 30%, and Snowflake's AI_CLASSIFY costs 25x more than AI_COMPLETE.

By Rajesh Beri·November 23, 2026·16 min read
Share:
A data engineer's desk at night with a monitor showing a long SQL query result grid scrolling past millions of rows, beside a printed cloud invoice with one line circled in red pen and a calculator.

Illustration generated using AI

Classifying 10 million support tickets with one SQL statement costs about $450 to $600 on a small model in Snowflake, Databricks or BigQuery, and $6,750 to $21,600 on a frontier model. Which model you pick moves the bill by roughly 40x. Which warehouse you run it in moves it by under 30%. The line that surprises people is Snowflake's fixed-rate AI_CLASSIFY, which costs about 25 times more than asking a small model the same question through AI_COMPLETE.

Our recommendation: run row-level LLM work in the warehouse where the data already lives, call a small model through the general completion function, write the result to a table, and never put the function inside a view a dashboard refreshes. For a one-off backfill on a frontier model, export the rows and use the model provider's batch API, which costs about half the in-SQL price everywhere except BigQuery.

All prices below were checked on each vendor's live pricing page on November 23, 2026.

Per 1M tokens (input / output) Snowflake AI_COMPLETE Databricks ai_query BigQuery AI.GENERATE Provider batch API
Billing unit AI Credits per 1M tokens, $2.00 each (global routing) DBUs per 1M tokens Vertex AI tokens + BigQuery compute $ per 1M tokens
Small model Claude Haiku 5.5: $0.12 / $0.60 Claude Haiku 5.5: $0.10 / $0.50 Gemini 3.1 Flash-Lite: $0.125 / $0.75 Claude Haiku 5.5: $0.05 / $0.25
Frontier model Claude Opus 5.5: $4.80 / $24.00 Claude Opus 5.5: $4.00 / $20.00 Gemini 4 Neon: $1.50 / $7.50 Claude Opus 5.5: $2.00 / $10.00
10M tickets, small model $540 $450 $575 $225
10M tickets, frontier model $21,600 $18,000 $6,750 $9,000
Warehouse compute on top Yes, billed in Platform Credits Yes, SQL warehouse or job cluster Yes, query bytes or slots None
Hard spend stop Per-user AI quotas (minutes) Unity Gateway budgets (approximate) Daily token quotas Provider spend limits

The worked example uses 400 input tokens and 10 output tokens per ticket (a 300-token ticket, the instruction and the label list in; one label out), so 4 billion input and 100 million output tokens in total. The Databricks figures use the $0.07 per DBU that its own pricing page uses as the AWS US East example; your contracted DBU rate replaces it. The BigQuery frontier column runs a different model family from the other three, so it shows the frontier model BigQuery calls natively, and the model behind it differs from the other columns.


How Each Warehouse Bills an LLM Call in SQL

Each platform bills tokens at the chosen model's rate, then bills the compute that runs the surrounding query as a separate line. The difference is which unit the tokens are counted in, and whether a discount reaches that unit.

Snowflake (Cortex AI) moved AI work onto its own currency this year. AI Credits "are separate from Platform Credits", per Snowflake's AI pricing page, and cost $2.00 each with global cross-region routing or $2.20 with regional routing. The April 6, 2026 release note started breaking the old AI_SERVICES billing type into finer service types as part of the transition. Two consequences buyers miss: "capacity discounts don't apply to AI Credits" (only an automatic discount tied to annual contract value does), and the per-model rate comes from Table 6(a) of the Snowflake Service Consumption Table, effective November 20, 2026. In that table claude-haiku-5-5 is 0.06 credits per 1M input tokens and 0.30 per 1M output; claude-opus-5-5 is 2.40 and 12.00. For generative functions, "both input and output tokens are billable", per the Snowflake Cortex AI Functions cost page.

Databricks (Mosaic AI) bills ai_query against whatever Model Serving endpoint you name, in DBUs per 1M tokens. The proprietary foundation model price list puts Claude Haiku 5.5 at 1.429 DBU in and 7.143 out, and Claude Opus 5.5 at 57.143 and 285.714. Open models sit on a separate list: Llama 3.1 8B is 2.143 in and 6.429 out. The AI Functions docs are explicit that "the compute that runs your query is always billed, for example a SQL warehouse or job cluster", and that task functions like ai_classify run on Databricks-managed serverless GPUs "billed in addition to your query compute."

BigQuery passes the model call through to Google's model platform (Vertex AI, which serves Gemini). The generative AI overview says you pay for the compute that runs the query, and "queries against remote models also incur charges" from the model platform. Google's October 2026 cost-management post gives the example rate: Gemini 3.1 Flash-Lite at $0.125 per 1M input and $0.75 per 1M output tokens, because "BigQuery processes in batch which provides a 50% discount." That makes BigQuery the one platform where the in-SQL path already gets batch pricing.

A token is the smallest unit of text a model reads or writes; roughly three-quarters of an English word. Every rate in this article is per million of them.


Model Choice Is the Biggest Cost Lever

The model you allow moves the bill far more than the platform does. On Snowflake, the same 10 million tickets cost $540 on Claude Haiku 5.5 and $21,600 on Claude Opus 5.5, a 40x spread from one string argument.

Here is the arithmetic on each platform, using the per-model rates above:

  • Snowflake, Claude Haiku 5.5: 4,000 × 0.06 + 100 × 0.30 = 270 AI Credits, or $540 at $2.00 ($594 with regional routing).
  • Snowflake, Opus 5.5: 4,000 × 2.40 + 100 × 12.00 = 10,800 AI Credits, or $21,600.
  • Databricks, Haiku 5.5: 4,000 × 1.429 + 100 × 7.143 = 6,430 DBU, or $450 at $0.07.
  • Databricks, Opus 5.5: 4,000 × 57.143 + 100 × 285.714 = 257,143 DBU, or $18,000.
  • BigQuery, Gemini 3.1 Flash-Lite: 4,000 × $0.125 + 100 × $0.75 = $575.
  • BigQuery, Gemini 4 Neon at the batch rate on Google's Gemini price list ($1.50 in, $7.50 out): $6,750. Confirm the rate for your region before you budget.

Snowflake prices Anthropic and OpenAI models about 20% above the providers' own list prices at global routing: Haiku 5.5 is $0.12 / $0.60 in Snowflake against $0.10 / $0.50 on Anthropic's price list, and GPT-6 Luna is the same $0.12 / $0.60 against $0.10 / $0.50 on OpenAI's. Databricks, at its example DBU rate, lands on the providers' list price exactly. So for a classification job the platform premium is tens of dollars, and the model premium is tens of thousands.

Check the footnotes as well. Snowflake's table marks gemini-3.7-flash and gemini-3.8-flash as promotional, with prices rising 100% on January 1, 2027, and gemini-4-argon and gemini-4-carbon rising 100% on December 1, 2026. Google's own price list shows the same January step for Gemini 3.8 Flash. A job you cost out this week on a promotional model can double without anyone changing a line of SQL.


Why Snowflake's AI_CLASSIFY Is the Expensive Way to Classify

AI_CLASSIFY is the loser in this comparison. It bills a flat 1.62 AI Credits per 1M tokens in the consumption table, which is $3.24 per 1M at global routing, input and output alike. Run the same 10 million tickets through it and the bill is roughly 4,100 × 1.62 = 6,642 credits, or about $13,300. Through AI_COMPLETE with claude-haiku-5-5 and a structured-output prompt, it is $540.

The real bill runs higher than that, because Snowflake's cost page says AI_CLASSIFY, AI_FILTER, AI_AGG and AI_SENTIMENT add their own prompt to your input, and that AI_CLASSIFY label names and descriptions count as input tokens "for each record processed." The billed token count is higher than the text you sent. AI_FILTER carries the same 1.62 rate, AI_EXTRACT is 5.55, and AI_SUMMARIZE is 1.60.

The task functions are convenient: no prompt to write, no model to choose, one line of SQL. On a few thousand rows the convenience is worth the premium. On a table with millions of rows, write the prompt yourself.

Databricks has the same trap in a different shape. Its task functions (ai_classify, ai_extract) run on Databricks-managed systems whose model the docs do not name, and they land in system.billing.usage under billing_origin_product = 'AI_FUNCTIONS' rather than at a published per-token rate. You cannot price a 10-million-row run in advance, so test it on a sample and read the billing table before you scale.

BigQuery's equivalent goes the other way. AI.CLASSIFY and AI.IF have an optimised mode (optimization_mode => 'MINIMIZE_COST') that, per the optimisation guide, calls Gemini on a sample, trains a distilled model, and runs that model on most rows. Google claims it "significantly" reduces token use but publishes no percentage. It needs embeddings and roughly 3,000 rows minimum.


The Hidden Lines: Warehouse Compute, Retries and Refreshes

The token line is the number you modelled. Three other lines are why the invoice disagrees with it.

The warehouse keeps running. Snowflake says warehouse cost "continues to apply when executing a query that calls a Snowflake Cortex LLM Function", and recommends a warehouse "no larger than MEDIUM" for AI Functions, because a bigger one does not speed up the model calls. A standard Medium warehouse burns 4 Platform Credits an hour (Table 1(a) of the consumption table) for every hour the statement runs. On Databricks, the SQL warehouse or job cluster bills alongside the serving DBUs. On BigQuery, the scan is cheap: on-demand queries cost $6.25 per TiB on BigQuery's price list, so a ticket table of about 15 GB costs around ten cents to read. Against a $540 token bill, warehouse time is noise if the job finishes in an hour or two and material if it runs all day on a larger warehouse than Snowflake recommends.

Retries re-bill completed rows. A single CREATE TABLE AS SELECT AI_COMPLETE(...) over 10 million rows is one statement. If it fails at row 9 million, the rows it already sent to the model have been billed and nothing was written. Write in batches (by date, by ID range) into a target table and select only rows without a result. BigQuery makes the partial case visible: when a token quota runs out mid-query, AI.GENERATE finishes but leaves skipped rows with the error in its status column, per Google's cost-management post. Re-run only those rows.

Dashboards re-run the model. Put AI_COMPLETE or AI.GENERATE inside a view, point a dashboard at it, and every refresh re-classifies every row in scope. At $540 a pass, an hourly refresh is $12,960 a day for answers that did not change. Snowflake's cost management guide covers the quotas and budgets that catch it (next section). A cost-observability vendor, Revefi, describes the same pattern with Cortex Search re-embedding unchanged rows on every upstream load, and data consultancy Aimpoint Digital argues that the largest jumps come from errors that make a process spend far more tokens than it should. Classify once into a column, then classify only new rows.


What Spend Controls Each Platform Gives You

All three now ship a control that can block spend. None of them is on by default at a level that would stop a 10-million-row mistake.

Snowflake. Per-user AI quotas are, in Snowflake's words, "the only AI cost control with built-in enforcement", and blocks apply "within minutes of the limit being reached." Budgets can cover AI Functions but can take "up to eight hours to take effect." Usage lands in CORTEX_AI_FUNCTIONS_USAGE_HISTORY (data from January 5, 2026); the older CORTEX_FUNCTIONS_USAGE_HISTORY views were slated for deprecation on November 22, 2026, so check any dashboard still built on them. Per the model access control docs, the account-wide CORTEX_MODELS_ALLOWLIST parameter can no longer be changed to a new value as of August 2026, and accounts set to 'All' (including new ones) grant CORTEX-MODEL-ROLE-ALL to the SNOWFLAKE.PUBLIC application role, which every user inherits through PUBLIC. In those accounts every user can call Opus 5.5. Revoke that grant and give analyst roles only the model roles for the small models.

Databricks. Unity Gateway rate limits cap requests or tokens per minute, per service, per user or per group, and return HTTP 429 past the limit. Budgets cover pay-per-token traffic and AI Functions with per-user daily or monthly thresholds and a "Block usage" action, but the docs call enforcement approximate and say not to treat it as an absolute cap. They also do not cover provisioned throughput endpoints. Per-request tokens and request_tags land in system.ai_gateway.usage (usage tracking), and endpoint custom_tags show up in system.billing.usage (model serving cost tables).

BigQuery. Daily token quotas cover AI.GENERATE, AI.CLASSIFY, AI.IF, AI.SCORE and AI.AGG at project and user level, are global across regions, and reset at midnight Pacific. The defaults are 200 billion input and 20 billion output tokens per project per day, and 150 billion and 15 billion per user. At Flash-Lite's $0.125 per 1M input, the default project input quota alone allows about $25,000 of input tokens a day, so lower it. Cost attribution runs through the bigquery_job_id_prefix label in Cloud Billing, and the overview warns charges can take up to 24 hours to appear.


When the Provider's Batch API Beats Calling the Model From SQL

For a one-off backfill on Snowflake or Databricks, the provider's batch API is cheaper. The Anthropic Batch API gives "a 50 percent discount on both input and output tokens": Haiku 5.5 at $0.05 / $0.25 and Opus 5.5 at $2 / $10 per 1M. OpenAI's batch prices are also half its standard rates (GPT-6 Luna at $0.05 / $0.25). The same 10 million tickets cost $225 on Haiku 5.5 or $9,000 on Opus 5.5, against $540 and $21,600 in Snowflake.

The batch API wins when all four of these hold: the job is a backfill, not a recurring pipeline; you can wait up to a day for results; your security team already approves sending this data to the provider directly; and the saving is larger than an engineer's day of export, upload, polling and reload work. On a small model that last test usually fails, because $315 of savings will not pay for the plumbing. On a frontier model, $12,600 will.

Stay in SQL when the data cannot leave the platform's governance boundary, when the job runs every day on new rows, or when you are on BigQuery, where the in-SQL path already runs at batch rates. Databricks also sells provisioned "Batch Inference" capacity by the hour (171.429 DBU per hour for Opus 5.5, 21.429 for Haiku 5.5, on the price list); it only beats pay-per-token if a sample run shows the endpoint pushing enough tokens per hour, so measure before you reserve. For the cross-provider view of batch, flex and priority tiers, see our batch vs flex vs priority comparison.


Who Should Not Pick Each Option

Skip Snowflake's task functions (AI_CLASSIFY, AI_FILTER, AI_EXTRACT) for any table over a few hundred thousand rows. At $3.24 per 1M tokens and up, they cost more than a frontier-class Gemini model in BigQuery. Use AI_COMPLETE with a small model and a fixed label list.

Skip Snowflake for frontier-model backfills. At $4.80 / $24.00 for Opus 5.5 it is the most expensive place in this comparison to run one, and capacity discounts do not reach AI Credits. Export to the batch API.

Skip Databricks task functions when finance needs a forecast. With no named model and no published per-token rate, the only way to price them is a sample run. Use Databricks ai_query against a named databricks- endpoint instead.

Skip BigQuery AI.GENERATE if your standard model is Claude. The overview describes AI.GENERATE as a Gemini function; Claude and other partner models are reachable through remote models and AI.GENERATE_TEXT, which is a separate path to set up and govern.

Skip the provider batch API for recurring jobs, for data your security team will not send out of the warehouse, and for small-model jobs where the saving is a few hundred dollars.


How to Decide: The Criteria That Predict Regret

The model allowlist decides most of the bill, so settle it before the warehouse question. Teams that regret an AI SQL bill almost always got one of these wrong:

  1. Did you pick the model, or did the analyst? If PUBLIC holds every model role in Snowflake, or any user can name any databricks- endpoint, the default model is whatever someone typed. Restrict it to one small model first.
  2. Is the output materialised? A classification stored in a column costs once. A function in a view costs on every read.
  3. Do you know your tokens per row? Run the query with LIMIT 1000, read the token count from the usage view, and multiply. The example here assumed 400 in and 10 out; a prompt with a long label list or few-shot examples can double the input.
  4. Is the price promotional? Read the footnotes in Snowflake's consumption table and on the Databricks and Google price lists before you commit a recurring job to a model.
  5. Is the hard stop set below the budget? Snowflake per-user quotas, Databricks Gateway budgets set to block, BigQuery token quotas lowered from the default.

What changes the answer: a negotiated DBU rate below $0.07 makes Databricks cheaper still; a Snowflake contract large enough to earn the ACV discount on AI Credits narrows its 20% premium; and a frontier backfill on Snowflake or Databricks over about $2,000 is usually worth exporting to the batch API.

This Week:

  1. Query CORTEX_AI_FUNCTIONS_USAGE_HISTORY, system.ai_gateway.usage or the Vertex AI billing export grouped by model and user, and find who is calling a frontier model from SQL.
  2. In Snowflake, check whether SNOWFLAKE.PUBLIC holds CORTEX-MODEL-ROLE-ALL and revoke it if so.
  3. Lower BigQuery's default token quotas to roughly twice your observed daily peak.

This Month:

  1. Find every view or dashboard dataset that calls an AI function and replace it with a materialised column plus an incremental job for new rows.
  2. Rewrite any AI_CLASSIFY job over a million rows as AI_COMPLETE on a small model, and compare the label agreement on a 1,000-row sample before you switch.
  3. Set a per-user quota or a blocking Gateway budget for every role that can run AI functions.

Before the Next Backfill:

  1. Cost it with the arithmetic above, on the model you will actually use, at the promotional and post-promotion rate.
  2. If it is a frontier model on Snowflake or Databricks, price the provider batch API path and the engineering day it needs.

The Bottom Line

The warehouse vendors have made LLM calls as easy to write as SUM(), and the bill grows the same way a careless SELECT * does: a tiny cost per row, multiplied across every row and every refresh. Snowflake charges about 20% over the providers' list for Anthropic and OpenAI models, Databricks charges list at its example DBU rate, and BigQuery passes through Google's batch discount. Those gaps are real, but they are small next to the 40x between Haiku 5.5 and Opus 5.5, or the 25x between AI_CLASSIFY and AI_COMPLETE on the same rows.

Restrict the model list before you compare warehouses.

Continue Reading

Share:

Frequently Asked Questions

How much does Snowflake charge per AI Credit for Cortex AI Functions?

As of November 23, 2026, Snowflake's AI pricing page lists $2.00 per AI Credit with global cross-region routing and $2.20 with regional routing. AI Credits are separate from Platform Credits, and capacity discounts do not apply to them.

Is Snowflake AI_CLASSIFY cheaper than AI_COMPLETE?

No. AI_CLASSIFY bills a flat 1.62 AI Credits per 1M tokens ($3.24 at global routing) and adds its own prompt tokens. AI_COMPLETE on claude-haiku-5-5 is 0.06 credits in and 0.30 out, so 10M tickets cost about $540 versus roughly $13,300 through AI_CLASSIFY.

Does BigQuery AI.GENERATE get the Gemini batch discount?

Google's October 2026 cost-management post says BigQuery processes AI function calls in batch, which gives a 50% discount, and quotes Gemini 3.1 Flash-Lite at $0.125 per 1M input and $0.75 per 1M output tokens. BigQuery query compute is billed on top.

When is the provider batch API cheaper than calling an LLM from SQL?

For one-off backfills on Snowflake or Databricks that can wait up to a day and whose data may leave the platform. Anthropic's Batch API halves list prices, so 10M tickets on Opus 5.5 cost about $9,000 versus $21,600 in Snowflake. On BigQuery the in-SQL path is already batch priced.

How do I cap AI function spend in Databricks?

Route calls through Unity Gateway and set rate limits (requests or tokens per minute, per user or group) plus budgets with a Block usage action. Databricks calls budget enforcement approximate, and budgets do not cover provisioned throughput endpoints.

Newsletter

More on AI ROI & Cost, every Sunday

The week's enterprise AI news, AI ROI & Cost included, in one Sunday email.

Weekly, free. Unsubscribe any time. Privacy

Latest Articles

View All →