cURL
curl --request GET \ --url https://agentgate.mynewapi.com/api/v1/usage/summary \ --header 'Authorization: Bearer <token>'
{ "success": true, "data": { "totalInputTokens": 123, "totalOutputTokens": 123, "totalCachedInputTokens": 123, "totalCostUsd": 123, "executionCount": 123, "workOrderCount": 123, "totalDurationMs": 123, "byModel": {}, "periodStart": "<string>", "periodEnd": "<string>" } }
Get aggregated usage summary with totals and per-model breakdown
curl "https://agentgate.mynewapi.com/api/v1/usage/summary?startDate=2024-01-01&endDate=2024-01-31" \ -H "Authorization: Bearer YOUR_API_KEY"
Show properties
{ "success": true, "data": { "totalInputTokens": 1542000, "totalOutputTokens": 325000, "totalCachedInputTokens": 800000, "totalCostUsd": 52.34, "executionCount": 145, "workOrderCount": 42, "totalDurationMs": 4523000, "byModel": { "claude-sonnet-4-20250514": { "inputTokens": 1200000, "outputTokens": 250000, "cachedInputTokens": 650000, "costUsd": 38.50, "executionCount": 120 }, "claude-opus-4-20250514": { "inputTokens": 342000, "outputTokens": 75000, "cachedInputTokens": 150000, "costUsd": 13.84, "executionCount": 25 } }, "periodStart": "2024-01-01T00:00:00.000Z", "periodEnd": "2024-01-31T23:59:59.999Z" } }