Problem
You want to show customers a log of their AI requests — model used, tokens consumed, cost, and status — with pagination and optional filtering.Solution
Userequests.list() with a customer_id filter and map the results into a display-friendly format.
API Route with Pagination
Filter by Feature
Use metadata headers when making AI requests, then filter on them later:Export to CSV
Next Steps
Usage Analytics
Aggregate usage data for dashboards and billing reports
Forward Proxy
Learn how to attach metadata headers to proxy requests