---
title: "Usage Logs & CSV Cost Exports | Straitly Docs"
description: "Inspect per-request token counts, latency, status codes and USD charges, and export usage logs for billing reconciliation."
url: https://straitly.ai/docs/logs
updated: 2026-11-25
publisher: Straitly (https://straitly.ai)
---

Docs

Account

# Logs & exports

Copy docs

**On this page**

Use Activity to inspect recorded requests, understand latency, and reconcile charges. Export a filtered view as CSV or JSON for your own analysis.

### Inspect a request

Open Activity and expand a request for its token buckets, charge, latency, and error details. Recording is asynchronous; refresh after a short delay if a completed request is not visible yet.

Usage

**Token buckets** Fresh input, cache read, cache-write durations, and output.

Performance

**TTFT & duration** Time to first token and total request duration, when recorded.

Billing

**Request charge** Use the recorded historical charge rather than recalculating using today's rates.

[Open Activity](https://straitly.ai/app/activity)

### Export your data

The export endpoint is on straitly.ai, not the inference base URL. Authenticate with a Straitly account key or a permitted console session. Replace the sample Unix timestamps with your desired range.

CSV JSON

CSV

Copy Copied Failed

curl --get "https://straitly.ai/api/activity/export" \
  -H "Authorization: Bearer $STRAITLY_API_KEY" \
  --data-urlencode "format=csv" \
  --data-urlencode "since=1791331200" \
  --data-urlencode "until=1791417599" \
  --data-urlencode "status=error" \
  -o activity.csv

### Filters and fields

- format: csv or json. The default is CSV.
- since and until: Unix timestamps in seconds, with inclusive boundaries.
- model: an exact model filter; status: ok or error.
- key\_id: only the requests sent with one API key. Use the key\_id from Activity (expand a request) or from a previous export. A key\_id that is not one of your account's keys returns no rows.
- Each row carries key\_id and key\_label: the id of the API key that sent the request and the name you gave that key. Both are empty on older rows recorded before keys were stamped.
- JSON also includes key\_totals: requests, failed, total\_tokens, and charged\_usd per key for the exported rows.
- JSON includes exported\_at, count, truncated, and rows. Monetary export fields such as charged\_usd are serialized with eight decimal places.
- Some older rows have no stream or latency metadata. An empty field means unrecorded, not necessarily false or zero.

### Spend per API key

Give each agent, service, or environment its own API key, and the export splits usage and spend by key. Filter to one key with key\_id, or export everything and group by key\_id. In JSON, key\_totals already holds the per-key sums for the range.

One key Totals per key

One key

Copy Copied Failed

curl --get "https://straitly.ai/api/activity/export" \
  -H "Authorization: Bearer $STRAITLY_API_KEY" \
  --data-urlencode "format=csv" \
  --data-urlencode "since=1791331200" \
  --data-urlencode "until=1791417599" \
  --data-urlencode "key_id=YOUR_KEY_ID" \
  -o agent-spend.csv

One key per agent gives per-agent spend. The key\_id is not a credential: it identifies a key in your own records and cannot be used to authenticate.

### Large exports

An export returns at most 50,000 rows, newest first. Inspect x-straitly-truncated in either format and truncated in JSON. A true flag means you should narrow the time range rather than assume the file is complete.

Split large exports into smaller time windows. Since boundaries are inclusive, deduplicate overlapping results by request\_id. A timestamp range is not a stable cursor; if many requests share a boundary timestamp, use smaller windows and contact support if you cannot export the full set.

### Share and retain responsibly

Request metadata can contain sensitive error details. Redact exports before sharing them publicly. Download records you need for your own retention requirements; this page does not promise indefinite server-side retention.

The partner request-history API has a separate contract from Activity exports. Use its cursor pagination when integrating child-key history.

[Child-key request history](https://straitly.ai/docs/child-keys#request-history) [Help & community](https://straitly.ai/docs/support)

[Teams & roles](https://straitly.ai/docs/teams) [Data retention](https://straitly.ai/docs/data-retention)

---
Markdown version of https://straitly.ai/docs/logs.
