Get Service Metering
const url = 'https://example.com/api/v1/usage/service-metering?start_date=2026-04-15T12%3A00%3A00Z&end_date=2026-04-15T12%3A00%3A00Z';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/v1/usage/service-metering?start_date=2026-04-15T12%3A00%3A00Z&end_date=2026-04-15T12%3A00%3A00Z'Get service metering history across all Snowflake services.
This endpoint queries METERING_HISTORY to provide comprehensive credit usage data across warehouses, serverless features, and other services.
Args: start_date: Start date for the query end_date: End date for the query service_type: Optional service type filter
Returns: ServiceMeteringResponse with service metering records
Raises: HTTPException: If query fails
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Start date for the query
Start date for the query
End date for the query
End date for the query
Header Parameters
Section titled “Header Parameters”Responses
Section titled “Responses”Successful Response
Response model for service metering history.
object
List of service metering records
Service metering record model (from METERING_HISTORY).
object
Start of the hour
End of the hour
Type of service consuming credits
Total credits used
Credits used for compute
Credits used for cloud services
Total credits across all records
Query start date
Query end date
Number of records
Examplegenerated
{ "records": [ { "start_time": "2026-04-15T12:00:00Z", "end_time": "2026-04-15T12:00:00Z", "service_type": "example", "name": "example", "credits_used": 1, "credits_used_compute": 1, "credits_used_cloud_services": 1, "bytes_processed": 1, "rows_processed": 1 } ], "total_credits": 1, "service_type": "example", "start_date": "2026-04-15T12:00:00Z", "end_date": "2026-04-15T12:00:00Z", "record_count": 1}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}