News

Snowflake makes prompt caching generally available for AI_COMPLETE

Reused tokens can be billed at a lower input rate in many-row queries with shared instructions on supported models.

D
Nov 25, 2026 · 2 min read

Snowflake has made prompt caching generally available for AI_COMPLETE, its Cortex AI function. The feature runs automatically for text inputs on supported models and requires no SQL changes.

When a query starts each row’s prompt with the same classification rules, a cache hit lets the function reuse its work on the rules and process each row’s data afresh. Snowflake charges the model’s cached input rate for tokens read from cache. Uncached input and generated output retain their standard rates.

Snowflake says cache hits require an exact match at the start of the prompt and a shared prefix long enough to meet the model provider’s minimum. Snowflake gives no numerical minimums for AI_COMPLETE in the guide. For the Claude API and the cloud platforms it lists, Anthropic specifies minimums of 1,024 tokens for Claude Sonnet 4.6 and 4,096 for Claude Opus 4.6.

Snowflake says the model provider typically keeps the prefix in cache for about five minutes and each hit resets that window. Cache hits are best effort. For Anthropic models, Snowflake marks a prefix for caching only when enough rows in a batch share it. The company says single-row calls and small queries usually see little benefit on those models.

With show_details set to TRUE, AI_COMPLETE returns the number of tokens read from cache in usage.prompt_cache_tokens on a hit and omits the field on a miss. The usage.prompt_tokens total includes cached tokens.

At the account level, Snowflake records token usage in CORTEX_AI_FUNCTIONS_USAGE_HISTORY. The caching guide’s example query reads cache_read_input from that view’s METRICS array.

Snowflake lists model-specific cached input rates in Table 6(a) of its Service Consumption Table. It shows a dash in the Cached Input column for llama3.3-70b. For claude-sonnet-4-6, Snowflake lists 0.180 AI Credits per million cached input tokens, 1.80 per million uncached input tokens and 9.00 per million output tokens.

More news