Snowflake Gen AI Governance · Topic 10 of 15
Cortex Analyst Costs and Cortex AI Function Token Costs
Cortex Analyst bills per message and AI functions per token; see which functions bill input and output, how to minimize tokens and use AI_COUNT_TOKENS.
- 4 min
- Analyst: per message, HTTP 200 only; warehouse separate; view CORTEX_ANALYST_USAGE_HISTORY.
- AI functions: per token; embeddings and Cortex Guard bill input only.
- AI_EXTRACT counts a page as 970 tokens; audio is 50 tokens per second.
What it is
Two Cortex features sit at opposite ends of the billing spectrum. Cortex Analyst bills per message. Cortex AI functions (AI_COMPLETE, AI_CLASSIFY, AI_EXTRACT and the rest) bill per token processed. The exam tests whether you can say which unit applies and which habits lower the bill.
How it works
Cortex Analyst: per message
- Credits are charged per message processed. Only successful responses (HTTP 200) count.
- Token count does not change the price, except when Analyst is called through Cortex Agents, where it bills per token.
- The warehouse that runs the generated SQL is billed separately.
- Track it in
SNOWFLAKE.ACCOUNT_USAGE.CORTEX_ANALYST_USAGE_HISTORY(columns include START_TIME, END_TIME, REQUEST_COUNT, CREDITS and USERNAME, aggregated hourly). Usage also appears inMETERING_HISTORYunder service typeAI_SERVICES. - Cortex Analyst is not one of the per-user quota domains, so do not plan on quotas to cap it.
AI functions: per token
Snowflake Cortex AI functions incur compute cost based on tokens processed. A token is roughly four characters of text, varying by model. Rates are in credits per million tokens in the Snowflake Service Consumption Table.
| Billing pattern | Functions |
|---|---|
| Input and output tokens | AI_COMPLETE, AI_CLASSIFY, AI_FILTER, AI_AGG, AI_SUMMARIZE, AI_TRANSLATE, AI_EXTRACT, AI_REDACT, and the older SUMMARIZE |
| Input tokens only | AI_EMBED, AI_SIMILARITY, the EMBED_* functions, and Cortex Guard |
| Per page | AI_PARSE_DOCUMENT |
Other billing facts:
- Hidden prompt tokens. AI_CLASSIFY, AI_FILTER, AI_AGG, AI_SENTIMENT, AI_SUMMARIZE_AGG, TRANSLATE and similar functions add their own prompt, so billed tokens exceed your text.
- AI_CLASSIFY labels, descriptions and examples are billed for every record, not once per call.
- AI_EXTRACT counts each document page as 970 input tokens, and the
responseFormatargument counts as input too. - Audio counts as 50 tokens per second.
- Cortex Guard adds input token cost on top of AI_COMPLETE.
- The legacy
SNOWFLAKE.CORTEXversions bill the same way as their AI_* successors.
Minimizing tokens
| Habit | Why it saves |
|---|---|
| Send only the needed text | Tokens in equal cost |
| Trim or chunk long documents and keep prompts short | Input is billed |
| Keep AI_CLASSIFY labels and descriptions short | They repeat per row |
Set max_tokens in AI_COMPLETE model_parameters | Caps output (default is 4096) |
| Pick a smaller model for easy tasks | Smaller models cost fewer credits per token |
| Use the purpose-built function (AI_CLASSIFY, AI_FILTER) instead of a free-form prompt | Fewer tokens and tighter output |
| Filter rows in SQL before calling the function | Fewer calls |
Test on a sample with LIMIT | Avoid a full-table surprise |
AI_COUNT_TOKENS
AI_COUNT_TOKENS is a helper function that counts the tokens a text would use before you run the real call. It incurs only the compute cost of running it, not the model cost. Use it on a sample to size a batch.
Warehouse note
A warehouse is still needed to run the query. Snowflake advises a warehouse no larger than MEDIUM, because a bigger one does not make the function faster and only adds cost.
Implications
Cost scales with rows times tokens per row. A table of 1 million rows with long text and a large model can cost far more than the same task done on a filtered sample with a small model. Long prompts repeat on every row, so shared instruction text is a fixed cost per row.
When a question asks how to reduce the cost of an AI function over a large table, the answer is almost always: shorten input and prompt, filter rows first, choose a smaller model, or cap output tokens.
Common mistakes
Assuming message length changes Analyst price. It bills per message, except through agents.
Counting only your text. Added prompts and per-row labels add tokens.
Using a LARGE warehouse for AI queries. MEDIUM or smaller is advised.
Ignoring output tokens. Most generative functions bill output too.
Confusing AI_COUNT_TOKENS with a free model call. It only costs its own compute.
What to remember for the exam
- Analyst: per message, HTTP 200 only; warehouse separate; view CORTEX_ANALYST_USAGE_HISTORY.
- AI functions: per token; embeddings and Cortex Guard bill input only.
- AI_EXTRACT counts a page as 970 tokens; audio is 50 tokens per second.
- Lower cost by trimming input, filtering rows, small models and
max_tokens.
Check yourself
How is Cortex Analyst billed?
Per message processed, counting only successful HTTP 200 responses, with warehouse costs separate.
Which functions bill input tokens only?
Embedding and similarity functions such as AI_EMBED and AI_SIMILARITY, plus Cortex Guard.
How do you estimate tokens before running a batch?
Use AI_COUNT_TOKENS, which costs only its own compute.
Topic 10 of 15 in Snowflake Gen AI Governance
Test yourself on Snowflake Gen AI Governance
The full Snowflake GES-C02 question bank has 585 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.