Snowflake Gen AI Governance · Topic 13 of 15
Cortex Usage History and Metering Views in ACCOUNT_USAGE
Match ACCOUNT_USAGE views to cost questions: Analyst, AISQL, Search, REST API, provisioned throughput, METERING_DAILY_HISTORY and METERING_HISTORY.
- 4 min
- Analyst: CORTEX_ANALYST_USAGE_HISTORY (messages, credits). Search: daily, by consumption type.
- REST API: per request with INFERENCE_REGION. Provisioned throughput: PTU_COUNT, PTU_CREDITS.
- Totals: METERING_DAILY_HISTORY (daily) and METERING_HISTORY (hourly) with SERVICE_TYPE AI_SERVICES.
What it is
Each Cortex feature writes to its own view in SNOWFLAKE.ACCOUNT_USAGE. A scenario question describes a cost question and you pick the view. The skill is matching the feature to the view, knowing the grain (per call, hourly, daily) and the columns that answer the question.
How it works
Matching view to question
| View | Feature | Grain | Key columns |
|---|---|---|---|
CORTEX_ANALYST_USAGE_HISTORY | Cortex Analyst | Hourly | START_TIME, END_TIME, REQUEST_COUNT, CREDITS, USERNAME |
CORTEX_AISQL_USAGE_HISTORY | AI functions | Per function call, aggregated by hour | USAGE_TIME, MODEL_NAME, FUNCTION_NAME, TOKEN_CREDITS, TOKENS, QUERY_ID, QUERY_TAG, USER_ID, WAREHOUSE_ID |
CORTEX_SEARCH_DAILY_USAGE_HISTORY | Cortex Search | Daily | USAGE_DATE, SERVICE_NAME, CONSUMPTION_TYPE, CREDITS, MODEL_NAME, TOKENS |
CORTEX_REST_API_USAGE_HISTORY | Cortex REST API calls | Per request | REQUEST_ID, MODEL_NAME, TOKENS, TOKENS_GRANULAR, USER_ID, INFERENCE_REGION |
CORTEX_PROVISIONED_THROUGHPUT_USAGE_HISTORY | Provisioned throughput | Billing interval | PROVISIONED_THROUGHPUT_ID, MODEL_NAME, PTU_COUNT, PTU_CREDITS, TERM_START_DATE, TERM_END_DATE |
METERING_DAILY_HISTORY | All services | Daily | USAGE_DATE, SERVICE_TYPE, CREDITS_USED, CREDITS_BILLED |
METERING_HISTORY | All services | Hourly | SERVICE_TYPE, ENTITY_ID, NAME, CREDITS_USED |
CORTEX_ANALYST_USAGE_HISTORY
Credits per call, aggregated in one-hour increments, with message counts. Credits are based on messages processed. Data covers the last 365 days. Use it to answer "how many Analyst messages did each user send and what did it cost".
SELECT USERNAME, SUM(REQUEST_COUNT) AS messages, SUM(CREDITS) AS credits
FROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_ANALYST_USAGE_HISTORY
GROUP BY USERNAME;
CORTEX_AISQL_USAGE_HISTORY
Credits per AI function call, aggregated by hour, with one row per function, model, query and warehouse combination. USAGE_TIME is the hour in which the query completed. It holds only usage on or after 17 November 2025, and usage is recorded after the query completes. To include AI_PARSE_DOCUMENT, use CORTEX_AI_FUNCTIONS_USAGE_HISTORY instead.
The older CORTEX_FUNCTIONS_USAGE_HISTORY and CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY views are no longer updated; their pages point to CORTEX_AISQL_USAGE_HISTORY and CORTEX_AI_FUNCTIONS_USAGE_HISTORY. CORTEX_AI_FUNCTIONS_USAGE_HISTORY covers every AI function, including AI_PARSE_DOCUMENT. If the question names AISQL, answer for AISQL.
CORTEX_SEARCH_DAILY_USAGE_HISTORY
Daily credits per Cortex Search service by consumption category. CONSUMPTION_TYPE is SERVING, EMBED_TEXT_TOKENS or BATCH. MODEL_NAME and TOKENS are filled only for EMBED_TEXT_TOKENS. BATCH covers batch search queries, with details in CORTEX_SEARCH_BATCH_QUERY_USAGE_HISTORY. It does not include every cost of a service, such as the refresh warehouse.
CORTEX_REST_API_USAGE_HISTORY
Tokens and credits for Cortex REST API requests, per request, with the model, user and the region where inference ran (INFERENCE_REGION, useful with cross-region inference). TOKENS_GRANULAR splits input and output. Data covers 365 days. This is where REST usage appears when no SQL query exists.
CORTEX_PROVISIONED_THROUGHPUT_USAGE_HISTORY
Billing data for provisioned throughput: a reserved capacity for a model, counted in PTUs, with a start and end date for its term. Each row shows the model, PTU_COUNT and PTU_CREDITS for an interval. Think "committed capacity" rather than per-call usage.
METERING_DAILY_HISTORY and METERING_HISTORY
| Point | METERING_DAILY_HISTORY | METERING_HISTORY |
|---|---|---|
| Grain | One row per day and service type | Hourly |
| Cloud services | Includes the adjustment column CREDITS_ADJUSTMENT_CLOUD_SERVICES and CREDITS_BILLED | Compute and cloud services credits |
| Latency | Up to about 180 minutes | Up to 180 minutes; cloud services credits up to 6 hours |
| Retention | 365 days | 365 days |
AI-related SERVICE_TYPE values: AI_SERVICES for Cortex AI functions (including LLM functions) and Cortex Analyst, and SNOWPARK_CONTAINER_SERVICES for SPCS. Cloud services are billed only when daily cloud services usage exceeds 10 percent of daily warehouse usage.
SELECT USAGE_DATE, SERVICE_TYPE, CREDITS_USED, CREDITS_BILLED
FROM SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORY
WHERE SERVICE_TYPE = 'AI_SERVICES'
ORDER BY USAGE_DATE DESC;
Common mistakes
Using METERING_HISTORY for per-user questions. It has no user column; use the feature view.
Looking for REST calls in the AI functions view. They are in CORTEX_REST_API_USAGE_HISTORY.
Expecting fresh data instantly. Metering views lag up to 3 hours.
Treating the Search view as the full Search bill. The refresh warehouse is separate.
Confusing provisioned throughput with per-token billing. It is billed by PTU term.
What to remember for the exam
- Analyst: CORTEX_ANALYST_USAGE_HISTORY (messages, credits). Search: daily, by consumption type.
- REST API: per request with INFERENCE_REGION. Provisioned throughput: PTU_COUNT, PTU_CREDITS.
- Totals: METERING_DAILY_HISTORY (daily) and METERING_HISTORY (hourly) with SERVICE_TYPE AI_SERVICES.
- Analyst, Search, REST API, provisioned throughput and the METERING views keep 365 days of data.
Check yourself
Which view shows the region where a REST API request was processed?
CORTEX_REST_API_USAGE_HISTORY, in the INFERENCE_REGION column.
Which SERVICE_TYPE holds Cortex AI functions and Analyst credits?
AI_SERVICES in METERING_HISTORY and METERING_DAILY_HISTORY.
What do PTU_COUNT and PTU_CREDITS describe?
Provisioned throughput capacity and the credits billed for it in an interval.
Topic 13 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.