def get_usage_stats() -> Dict[str, int]

Returns

  • Dict[str, int]: Mapping of operation types (e.g. "query", "agent") to total tokens used.

Example

stats = db.get_usage_stats()
print(stats["query"], "tokens consumed for queries")