Skip to main content
The Metrics Summary endpoint (/v1/metrics/summary) returns an at-a-glance overview of your account’s core usage metrics across all of your API keys. It combines your unique agent configurations (from /v1/agents/list) with completion-call counts derived from your request history into one response, so you don’t have to call and aggregate those endpoints yourself. This is the endpoint to power a usage dashboard: unique agents used, lifetime completion calls, and recent-window activity.
All counts are computed with database count queries, so your totals stay accurate even after your account passes 1,000 lifetime executions (Supabase’s default row cap). Counting rows client-side would silently plateau at 1,000 — this endpoint does not.

Endpoint Information

  • URL: /v1/metrics/summary
  • Method: GET
  • Authentication: Required (x-api-key header)
  • Rate Limiting: Subject to tier-based rate limits

Response Format

The endpoint returns a JSON object with the following fields:
FieldTypeDescription
successbooleanIndicates the summary was retrieved successfully.
unique_agentsintegerNumber of unique agent configurations you have used.
total_completion_callsintegerLifetime count of completion calls (accurate past 1,000).
successful_completionsintegerLifetime count of completions with status "success".
completions_last_24hintegerCompletion calls in the last 24 hours.
completions_last_7dintegerCompletion calls in the last 7 days.
agentsarrayYour unique agent configurations, sorted by last used (same as /v1/agents/list).
timestampstringISO 8601 UTC timestamp when the summary was generated.

Example Response

{
  "success": true,
  "unique_agents": 80,
  "total_completion_calls": 25583,
  "successful_completions": 13516,
  "completions_last_24h": 2,
  "completions_last_7d": 1151,
  "agents": [
    {
      "agent_name": "Research Assistant",
      "model_name": "gpt-4.1",
      "last_used": "2026-07-06T07:51:21.942717+00:00"
    }
  ],
  "timestamp": "2026-07-06T11:54:17.401905+00:00"
}

Use Cases

  • Usage dashboards: Populate headline tiles (executions, success rate, unique agents) from a single, cheap request.
  • Accurate lifetime totals: Report true all-time completion counts without transferring — or capping at — thousands of log rows.
  • Activity monitoring: Track 24-hour and 7-day completion volume to spot spikes or drop-offs.
import json
import os
from typing import Any, Dict

import requests
from dotenv import load_dotenv

load_dotenv()

BASE_URL = "https://api.swarms.world"

HEADERS = {
    "x-api-key": os.getenv("SWARMS_API_KEY"),
    "Content-Type": "application/json",
}

def get_metrics_summary() -> Dict[str, Any]:
    """Retrieve a summary of your core usage metrics"""
    try:
        response = requests.get(
            f"{BASE_URL}/v1/metrics/summary",
            headers=HEADERS,
        )
        assert response.status_code == 200, f"Expected 200, got {response.status_code}: {response.text}"
        data = response.json()

        print(json.dumps(data, indent=4))
        print(f"Unique agents:           {data['unique_agents']}")
        print(f"Total completion calls:  {data['total_completion_calls']}")
        print(f"Successful completions:  {data['successful_completions']}")
        print(f"Last 24h / 7d:           {data['completions_last_24h']} / {data['completions_last_7d']}")
        return data
    except Exception as e:
        print(str(e))
        return {}

if __name__ == "__main__":
    get_metrics_summary()
The agents array mirrors the data returned by /v1/agents/list — the numeric counts, however, reflect true lifetime totals regardless of how many logs exist. For full request logs, use /v1/swarm/logs.