Logs & exports
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 bucketsFresh input, cache read, cache-write durations, and output.
- Performance
- TTFT & durationTime to first token and total request duration, when recorded.
- Billing
- Request chargeUse the recorded historical charge rather than recalculating using today's rates.
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.
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.
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.