Skip to main content
The /v1/account/metrics/summary endpoint gives you all of your core usage metrics in a single call — perfect for powering a dashboard. In this tutorial you’ll fetch your metrics and print a small summary.
The older /v1/metrics/summary path is a deprecated alias for /v1/account/metrics/summary — both return the identical MetricsSummaryOutput shape, so existing integrations keep working, but new code should call /v1/account/metrics/summary.

Step 1 — Get your API key

Create an API key in your dashboard: https://swarms.world/platform/api-keys

Step 2 — Add it to .env

Step 3 — Fetch your metrics

Step 4 — Render the dashboard tiles

Pull the headline numbers out of the response and compute a success rate. These are the values you’d wire into dashboard cards.
Example output:

What you get back

Raw JSON response (MetricsSummaryOutput):
For a full field reference and use cases, see the User Metrics Summary capability page.