Download every usage record in a range as CSV or JSONL [read]

Changed on

One row per session call and one per API key, UTC day and kind, streamed. Columns: source, at, sessionId, sessionName, apiKeyId, apiKeyName, kind, model, provider, tool, calls, inputTokens, outputTokens, cachedInputTokens, cacheCreationTokens, listCostUsd, billedCostUsd, coveredBy (subscription when a connected plan paid), requestId. The same file Billing's export downloads.

get/billing/usage/export

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/billing/usage/export
  • Auth
    none declared

Query parameters

fromstring date

First UTC day included, YYYY-MM-DD; defaults to 29 days before today

tostring date

First UTC day excluded, YYYY-MM-DD; defaults to tomorrow. A range spans at most 366 days

source'session' | 'api_key'

Only sessions, or only developer API keys; both when omitted

api_key_idstring

Only this API key's usage

format'csv' | 'jsonl'

Response

The records

Changes