Schema:

ACCOUNT_USAGE

MODEL_SERVING_USAGE_HISTORY view

This Account Usage view can be used to query the estimated credit usage history for model serving (inference) workloads run through the Model Registry. The view consolidates usage from both ways that a model can be served:

  • Warehouse: The model function is called in a SQL query and runs as part of an ordinary warehouse operation.
  • Snowpark Container Services (SPCS): The model runs as an inference service or job deployed with SYSTEM$DEPLOY_MODEL. Estimated credit usage is based on the uptime of the SPCS service or job, regardless of whether it’s invoked through Python, REST, or a deployed service function.

Each row represents either an hour window of Snowpark Container Services usage for a model, or a single warehouse query that invoked one or more model functions. For SPCS, the view emits one row per hour window during which the service or job ran. If a service or job starts or ends partway through an hour, the row for that hour shows the estimated credits based only on the portion of the hour the service or job was up.

Note

Because this view provides estimated credits, the values might not exactly match the credits billed on your usage statement.

Columns

Column NameData TypeDescription
INVOCATION_TYPEVARCHARHow the model was served: SPCS or WAREHOUSE.
START_TIMETIMESTAMP_LTZFor SPCS rows, the start of the hour in which the usage took place. For warehouse rows, the time the query was submitted.
END_TIMETIMESTAMP_LTZFor SPCS rows, the end of the hour in which the usage took place. For warehouse rows, the time the query completed.
DATABASE_IDNUMBERID of the database containing the model.
DATABASE_NAMEVARCHARName of the database containing the model.
SCHEMA_IDNUMBERID of the schema containing the model.
SCHEMA_NAMEVARCHARName of the schema containing the model.
MODEL_IDNUMBERID of the model.
MODEL_NAMEVARCHARName of the model.
MODEL_VERSION_IDNUMBERID of the model version.
MODEL_VERSION_NAMEVARCHARName of the model version.
USER_NAMEVARCHARName of the user who ran the query that called the model function. NULL for SPCS rows.
CREDITSNUMBER(38, 9)Number of estimated credits attributed to the model serving usage. For SPCS rows, this is the sum of estimated credits attributed to the service for the hour. For warehouse rows, this is the query’s total estimated credits divided equally across the distinct model, model version, and function combinations that the query called.
COMPUTE_POOL_IDNUMBERID of the compute pool running the service. NULL for warehouse rows.
COMPUTE_POOL_NAMEVARCHARName of the compute pool running the service. NULL for warehouse rows.
SERVICE_IDNUMBERID of the Snowpark Container Services service or job running the model. NULL for warehouse rows.
SERVICE_NAMEVARCHARName of the Snowpark Container Services service or job running the model. NULL for warehouse rows.
WORKLOAD_TYPEVARCHARFor SPCS rows, SERVICE (a long-lived service, such as an online inference service or a model build) or JOB (a one-shot job, such as a batch inference job). For warehouse rows, always WAREHOUSE_INFERENCE.
FUNCTION_NAMEVARCHARName of the model function invoked (for example, PREDICT). NULL for SPCS rows.
QUERY_IDVARCHARID of the query that called the model function. NULL for SPCS rows.
WAREHOUSE_IDNUMBERID of the warehouse that ran the query. NULL for SPCS rows.
QUERY_TAGVARCHARQuery tag, if any, associated with the query that called the model function. NULL for SPCS rows.

Usage notes

  • Usage that occurred before August 25, 2026 might be included, but historical data prior to this date isn’t guaranteed to be complete.
  • The view provides up-to-date estimated credit usage for an account within the last 365 days (1 year).
  • Latency for the view might be up to 8 hours.
  • For SPCS rows, a row is emitted only for hours in which the service was up and had a nonzero amount of estimated credits attributed to it. If the service wasn’t running during an hour, no row is emitted for that hour.
  • For SPCS rows, the estimated credits shown are an attribution of compute pool usage to a model, not a precise, standalone charge. The actual charge comes from the compute pool itself; see SNOWPARK_CONTAINER_SERVICES_HISTORY. So if a compute pool runs only ML models, the sum of the estimated credits attributed to those models won’t equal the compute pool’s total cost, because compute pools also accrue idle time.
  • For warehouse rows, a row appears only after the query completes successfully and its estimated credits have settled in QUERY_ATTRIBUTION_HISTORY for classic warehouses (latency up to 8 hours) or QUERY_METERING_HISTORY for adaptive warehouses (latency up to 1 hour).
  • For warehouse rows, repeated calls to the same model, model version, and function within a single query are deduplicated into a single row. A query that calls multiple distinct model, model version, and function combinations produces one row per combination, with the query’s estimated credits split equally across them.
  • This view doesn’t include model import jobs, for example, jobs created by SYSTEM$IMPORT_MODEL or the import step that SYSTEM$DEPLOY_MODEL runs before deploying an inference service.

Examples

Retrieve model serving usage history:

SELECT *
  FROM SNOWFLAKE.ACCOUNT_USAGE.MODEL_SERVING_USAGE_HISTORY;
+-----------------+-------------------------------+-------------------------------+-------------+---------------+-----------+-------------+----------+------------------+------------------+--------------------+-----------+-------------+-----------------+-------------------+------------+---------------------+---------------------+---------------+--------------------------------------+--------------+-----------+
| INVOCATION_TYPE | START_TIME                    | END_TIME                      | DATABASE_ID | DATABASE_NAME | SCHEMA_ID | SCHEMA_NAME | MODEL_ID | MODEL_NAME       | MODEL_VERSION_ID | MODEL_VERSION_NAME | USER_NAME | CREDITS     | COMPUTE_POOL_ID | COMPUTE_POOL_NAME | SERVICE_ID | SERVICE_NAME        | WORKLOAD_TYPE       | FUNCTION_NAME | QUERY_ID                             | WAREHOUSE_ID | QUERY_TAG |
+-----------------+-------------------------------+-------------------------------+-------------+---------------+-----------+-------------+----------+------------------+------------------+--------------------+-----------+-------------+-----------------+-------------------+------------+---------------------+---------------------+---------------+--------------------------------------+--------------+-----------+
| SPCS            | 2026-08-20 14:00:00.000 +0000 | 2026-08-20 15:00:00.000 +0000 | 154         | ML_MODELS     | 2201      | PUBLIC      | 5001     | FRAUD_DETECTION  | 8001             | V1                 | NULL      | 0.041666667 | 301             | ML_INFERENCE_POOL | 4021       | FRAUD_DETECTION_SVC | SERVICE             | NULL          | NULL                                 | NULL         | NULL      |
+-----------------+-------------------------------+-------------------------------+-------------+---------------+-----------+-------------+----------+------------------+------------------+--------------------+-----------+-------------+-----------------+-------------------+------------+---------------------+---------------------+---------------+--------------------------------------+--------------+-----------+
| WAREHOUSE       | 2026-08-20 15:32:10.123 +0000 | 2026-08-20 15:32:12.456 +0000 | 154         | ML_MODELS     | 2201      | PUBLIC      | 5002     | CHURN_PREDICTION | 8002             | V2                 | JSMITH    | 0.000123000 | NULL            | NULL              | NULL       | NULL                | WAREHOUSE_INFERENCE | PREDICT       | 01b2c3d4-0001-1234-0000-0001abcd0002 | 21           | NULL      |
+-----------------+-------------------------------+-------------------------------+-------------+---------------+-----------+-------------+----------+------------------+------------------+--------------------+-----------+-------------+-----------------+-------------------+------------+---------------------+---------------------+---------------+--------------------------------------+--------------+-----------+