---
title: "Get Devbox counts by Agent."
method: GET
path: "/v1/agents/devbox_counts"
tags: ["agents"]
---

# Get Devbox counts by Agent.

`GET /v1/agents/devbox_counts`

Returns devbox counts grouped by agent name. This endpoint efficiently aggregates devbox counts for all agents in a single request, avoiding N+1 query patterns.

## Response `200`

Successfully retrieved devbox counts by agent name.

- AgentDevboxCountsView — Devbox counts grouped by agent name. Used to efficiently fetch devbox counts for multiple agents in a single request.
  - `counts` object, required — Map of agent name to devbox count. Each key is an agent name, and the value is the count of devboxes associated with that agent.
  - `total_count` integer, required — Total count of devboxes across all agents in the result.

## Other responses

- `401` — Unauthorized. Invalid or missing authentication.
- `403` — Forbidden. Account does not have devbox capability.
- `500` — Internal server error.

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/e9dc776053e4/schema)
