Skip to main content

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

Use requests.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