Usage Analytics

Get usage analytics with the Python SDK

Retrieve usage data and analytics.

Usage Summary

summary = await client.usage.summary(
    customer_id="customer_123",
    start_date="2024-01-01",
    end_date="2024-01-31",
)

Usage Breakdown

breakdown = await client.usage.breakdown(
    customer_id="customer_123",
    group_by=["model", "provider"],
    start_date="2024-01-01",
    end_date="2024-01-31",
)

Time Series

timeseries = await client.usage.timeseries(
    customer_id="customer_123",
    start_date="2024-01-01",
    end_date="2024-01-31",
    interval="day",
)

Next Steps

On this page