Tokens / fetch

Back to API Docs

API Overview

Path: /api/tokens/fetch — Method: GET

Auth: session-cookie

Request Details

No headers required

No path params required

Query

  • userID(string, required)
  • startDate(string)
  • endDate(string)

No body required

Responses

  • 200Token usage records
    [{"userID":"...","agentId":"...","inputTokens":123,"outputTokens":456,"totalTokens":579,"totalCost":0.0123,"createdAt":"..."}]
  • 400Missing userID
    {"error":"Missing userID"}
  • 500Failed to fetch token usage

Notes & Tips

  • Ensure headers match exactly (e.g., x-apikey).
  • Use Content-Type: application/json for JSON bodies.
  • For Bearer auth, you can provide either a session JWT or an opaque API key where supported.
Advancelytics | Detect Silent Churn, Surface Growth Signals