limitry.client.Customers

class limitry.client.Customers[source]

Bases: object

Operations for customers.

__init__(client)[source]

Initialize Customers operations.

Parameters:

client (Client) – The Limitry client instance

Return type:

None

Methods

__init__(client)

Initialize Customers operations.

get_usage(customer_id, start_date, end_date)

Get customer usage.

__init__(client)[source]

Initialize Customers operations.

Parameters:

client (Client) – The Limitry client instance

Return type:

None

async get_usage(customer_id, start_date, end_date)[source]

Get customer usage.

Retrieve usage summary for a specific customer within a date range.

This endpoint provides aggregated metrics for a single customer, making it ideal for: - Customer billing and invoicing - Per-tenant usage dashboards - Customer-specific analytics - Usage-based pricing calculations.

Parameters:
  • customer_id (str) – Customer identifier to get usage for (min length: 1)

  • start_date (str) – Start of the date range (ISO 8601 format) (ISO 8601 format, e.g., “2024-01-01T00:00:00Z”)

  • end_date (str) – End of the date range (ISO 8601 format) (ISO 8601 format, e.g., “2024-01-01T00:00:00Z”)

Returns:

Customer usage summary

Return type:

CustomerUsageResponse

Example:

result = await client.customers.get_usage(
    "customerid_123",
    start_date="2024-01-01T00:00:00Z",
    end_date="2024-01-01T00:00:00Z"
)
print(result)
Raises:
Parameters:
  • customer_id (str)

  • start_date (str)

  • end_date (str)

Return type:

CustomerUsageResponse