- Schema:
MODEL_ SERVING_ USAGE_ HISTORY view¶
Important
This view is only available in the organization account. For more information, see Premium views in the organization account.
This Organization Usage view can be used to query the estimated credit usage history for model serving (inference) workloads run through the Model Registry across all the accounts in your organization. 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.
- See also:
MODEL_SERVING_USAGE_HISTORY view (Account Usage)
Columns¶
Organization-level columns
| Column Name | Data Type | Description |
|---|---|---|
| ORGANIZATION_NAME | VARCHAR | Name of the organization. |
| ACCOUNT_LOCATOR | VARCHAR | System-generated identifier for the account. |
| ACCOUNT_NAME | VARCHAR | User-defined identifier for the account. |
Additional columns
| Column Name | Data Type | Description |
|---|---|---|
| INVOCATION_TYPE | VARCHAR | How the model was served: SPCS or WAREHOUSE. |
| START_TIME | TIMESTAMP_LTZ | For SPCS rows, the start of the hour in which the usage took place. For warehouse rows, the time the query was submitted. |
| END_TIME | TIMESTAMP_LTZ | For SPCS rows, the end of the hour in which the usage took place. For warehouse rows, the time the query completed. |
| DATABASE_ID | NUMBER | ID of the database containing the model. |
| DATABASE_NAME | VARCHAR | Name of the database containing the model. |
| SCHEMA_ID | NUMBER | ID of the schema containing the model. |
| SCHEMA_NAME | VARCHAR | Name of the schema containing the model. |
| MODEL_ID | NUMBER | ID of the model. |
| MODEL_NAME | VARCHAR | Name of the model. |
| MODEL_VERSION_ID | NUMBER | ID of the model version. |
| MODEL_VERSION_NAME | VARCHAR | Name of the model version. |
| USER_NAME | VARCHAR | Name of the user who ran the query that called the model function. NULL for SPCS rows. |
| CREDITS | NUMBER(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_ID | NUMBER | ID of the compute pool running the service. NULL for warehouse rows. |
| COMPUTE_POOL_NAME | VARCHAR | Name of the compute pool running the service. NULL for warehouse rows. |
| SERVICE_ID | NUMBER | ID of the Snowpark Container Services service or job running the model. NULL for warehouse rows. |
| SERVICE_NAME | VARCHAR | Name of the Snowpark Container Services service or job running the model. NULL for warehouse rows. |
| WORKLOAD_TYPE | VARCHAR | For 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_NAME | VARCHAR | Name of the model function invoked (for example, PREDICT). NULL for SPCS rows. |
| QUERY_ID | VARCHAR | ID of the query that called the model function. NULL for SPCS rows. |
| WAREHOUSE_ID | NUMBER | ID of the warehouse that ran the query. NULL for SPCS rows. |
| QUERY_TAG | VARCHAR | Query 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.
- Latency for the view might be up to 24 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 or QUERY_METERING_HISTORY for adaptive warehouses.
- 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_MODELor the import step thatSYSTEM$DEPLOY_MODELruns before deploying an inference service.
Examples¶
Retrieve model serving usage history across all accounts in the organization: