Schema:

ACCOUNT_USAGE

CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY view

Important

This view is no longer updated. Use the CORTEX_AI_FUNCTIONS_USAGE_HISTORY view instead.

The CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY view can be used to view the usage history of each Cortex Functions query in a Snowflake account. For more information, see Cost considerations.

The information in the view includes the number of tokens and credits consumed for each query.

The view also includes relevant metadata, such as the model name and the ID of the warehouse running the queries.

Columns

Column NameData TypeDescription
FUNCTION_NAMEVARCHARFunction name for the model.
MODEL_NAMEVARCHARModel name used in the query. A query can have more than one model. For queries with multiple models, the usage history includes a row for each model.
QUERY_IDVARCHARQuery ID
TOKENSNUMBERNumber of tokens used for the (QUERY_ID, MODEL_NAME, WAREHOUSE_ID) combination.
TOKEN_CREDITSNUMBERTokens converted to credits for the (QUERY_ID, MODEL_NAME, WAREHOUSE_ID) combination.
WAREHOUSE_IDVARCHARID of the warehouse used to run the query.

Usage notes

  • The view provides up-to-date credit usage for an account within the last 365 days (1 year).
  • Query usage data might take a few hours to appear in the CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY view.
  • Credit rate usage is based on the number of messages processed, as outlined in the Snowflake Service Consumption Table.