What you’ll learn
- Can I export usage for a single API key?
- How many rows can one export hold?
- Does the usage export replace the Management API?
- Which filters can I combine, and who can export?
A higher-than-expected AI bill is usually a data problem. The TokenLab Usage page can export the records behind its charts as a CSV or JSON file, so you can answer "what drove this spend" in a spreadsheet or a script. This guide shows where to find the export, which filters and columns it has, its row limit, and when another tool fits better.
Key Takeaways
- Open the Usage page, set your filters, and select Export, then Export CSV or Export JSON. The file contains the rows of the view you are looking at.
- You can filter by period (Today, Last 7 Days, Last 30 Days, or All Time), model, model maker, API key, operation, and delivery method.
- One export holds at most 10,000 matching rows. For more, narrow the period or the filters.
- Admins and owners export the whole workspace. Other members export only their own usage.
- The usage export has no request IDs. For request-level detail, use the export in Runs. For scheduled jobs, use the Management API.
Export from the Usage Page
- Open the Usage page in the workspace you want to review.
- Choose a period: Today, Last 7 Days, Last 30 Days, or All Time.
- Add filters if you need them: model, model maker, API key, operation (for example Chat, Image generation, or Video generation), and delivery method.
- Select Export, then Export CSV or Export JSON.
If the selected view has more than 10,000 requests, the page asks you to narrow the date range or filters before it exports. The spend and request counts on the page come from settled billing records, and the export uses the same records. Amounts that are only reserved, and refunded requests, are not in the file.
What Each Row Contains
Each row is one settled usage record. The file has 17 columns:
| Columns | What they hold |
|---|---|
| Date | Time of the request in UTC (ISO 8601) |
| Model, Model Vendor, Operation | The model that ran, who makes it, and the kind of call, such as chat or image generation |
| Requested Delivery, Resolved Delivery | The delivery option you asked for and the one that ran the request |
| Prompt Tokens, Completion Tokens, Total Tokens | Token counts |
| Cache Read Tokens, Cache Write Tokens, Non-Cached Prompt Tokens | Prompt cache activity |
| Billing Unit, Billing Quantity | What the request was billed on, such as tokens, images, or seconds, and how many |
| Cost (USD) | The charge for the request |
| Latency (ms), API Key Prefix | Request latency, and the first characters of the API key that made it |
The usage export does not include request IDs or error details. Use the request-level export below when you need them.
Which Tool to Use
| Need | Use |
|---|---|
| Review spend by model, key, operation, or period | Usage export (Usage page) |
| Find the exact requests, their IDs, status, and errors | Request-level export (Runs → Requests) |
| Pull usage on a schedule or alert on a key | Management API usage endpoint |
| Read balance, top-ups, and total spend from code | Management API balance endpoint |
Request-level export in Runs
The Requests list in Runs has its own Export current view button for admins and owners. It exports CSV or JSON for the current filters: period (Today, This month, Last month, or a custom range with a time zone), API key, prompt cache state, status, and model. Each row carries the Request ID, Billing Transaction ID, status, HTTP status, error code and message, async task fields, model, tokens, cost, balance after the request, and latency.
These exports run in the background and can hold up to 1,000,000 rows. Only one export runs at a time for a workspace. Finished files stay in Export history for 90 days. To open a single request from a row, see the Request Console guide.
Management API usage endpoint
Use the Get API Key Usage endpoint when a program, not a person, reads the numbers. It works with a management token (mt-...), and it returns one API key per call. Records come in pages of up to 100 and can be filtered by model, model vendor, scene, and dates. To cover every key, list them first with GET /v1/management/api-keys and call the usage endpoint for each key.
curl "https://api.tokenlab.sh/v1/management/api-keys/key_abc123def456/usage?page=1&limit=100&startDate=2026-11-01&endDate=2026-11-08" \
-H "Authorization: Bearer mt-your-management-token"
A date-only endDate means 00:00 UTC at the start of that day, so this request covers 1 to 7 November. Settled records include billing_transaction_id. Save it with request_id to match a charge to a request.
A Weekly Cost Review
A fixed routine catches cost drift before it becomes a budget problem:
- Pick a fixed day. Monday morning catches weekend anomalies.
- Open the Usage page, choose Last 7 Days, and look at spend by model and by API key.
- Export the view as CSV and keep it as the record for that week.
- Look for a model or key whose spend is well above its normal range.
- Filter to that model and key, then choose Today to isolate the day. Export again and check the operation, the cache columns, and the resolved delivery.
- Use the request-level export in Runs to find the request IDs behind the spike, then open them in the Request Console.
- Decide on an action: fix a retry loop, rotate a leaked key, or move a workflow to a cheaper model from the model list.
- Write the finding down where your team can see it, so the next review starts from a known baseline.
FAQ
Can I export usage for a single API key?
Yes. Choose the API key in the filters before you export. The file contains only that key's rows, and the API Key Prefix column shows which key made each request.
How many rows can one export hold?
The Usage page export holds up to 10,000 matching rows. If your view has more, narrow the period or the filters, or export in several windows such as one week each.
Does the usage export replace the Management API?
No. The export is for a person who reviews usage on demand. The Management API is for programs that read usage on a schedule, for example a nightly job or a threshold alert.
Which filters can I combine, and who can export?
You can combine period, model, model maker, API key, operation, and delivery method. There is no filter for a tag or a workflow. Admins and owners export the whole workspace. Other members export only their own usage.
To avoid interruptions from a low balance while you review spend, see the auto recharge guide. Open the Usage page to run your first export.
Sources
Prices checked 2026-11-11
- TokenLab Usage page (Dashboard)Sources checked 2026-11-11
- TokenLab docs: Get API Key UsageSources checked 2026-11-11
- TokenLab docs: Management APISources checked 2026-11-11
- TokenLab docs: Data retentionSources checked 2026-11-11



