---
title: "Get Queue Statistics"
method: GET
path: "/v1/environments/{environment_id}/work/stats?beta=true"
---

# Get Queue Statistics

`GET /v1/environments/{environment_id}/work/stats?beta=true`

Get statistics about the work queue for an environment.

## Path parameters

- `environment_id` string, required

## Headers

- `anthropic-beta` string — Optional header to specify the beta version(s) you want to use. To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.
- `anthropic-version` string — The version of the Claude API you want to use. Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
- `x-api-key` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- BetaSelfHostedWorkQueueStats — Statistics about the work queue for an environment. Uses Redis Stream consumer group metrics for O(1) queries.
  - `depth` integer, required — Number of work items waiting to be picked up (lag from consumer group)
  - `oldest_queued_at` string, nullable, required — RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty
  - `pending` integer, required — Number of work items being processed (polled but not acknowledged)
  - `type` 'work_queue_stats', required — The type of object
  - `workers_polling` integer, nullable, required — Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.

## Other responses

- `4XX` — Error response. See our [errors documentation](https://platform.claude.com/docs/en/api/errors) for more details.

---

[API](https://skmtc.net/anthropics/apis/anthropic-api.md) · [All operations](https://skmtc.net/anthropics/apis/anthropic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anthropics/anthropic-api/versions/93d8fd7d6493/schema)
