Repository Public
1---2title: Get Queue Statistics3url: https://platform.claude.com/docs/en/api/beta/environments/work/stats4---56# Get Queue Statistics78**GET** `/v1/environments/{environment_id}/work/stats`910Get statistics about the work queue for an environment.1112## Path parameters1314- `environment_id: string`1516## Headers1718- `"anthropic-beta": optional array of AnthropicBeta`1920 Optional header to specify the beta version(s) you want to use.2122 - `string`2324 - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2526 - `"message-batches-2024-09-24"`2728 - `"prompt-caching-2024-07-31"`2930 - `"computer-use-2024-10-22"`3132 - `"computer-use-2025-01-24"`3334 - `"pdfs-2024-09-25"`3536 - `"token-counting-2024-11-01"`3738 - `"token-efficient-tools-2025-02-19"`3940 - `"output-128k-2025-02-19"`4142 - `"files-api-2025-04-14"`4344 - `"mcp-client-2025-04-04"`4546 - `"mcp-client-2025-11-20"`4748 - `"dev-full-thinking-2025-05-14"`4950 - `"interleaved-thinking-2025-05-14"`5152 - `"code-execution-2025-05-22"`5354 - `"extended-cache-ttl-2025-04-11"`5556 - `"context-1m-2025-08-07"`5758 - `"context-management-2025-06-27"`5960 - `"model-context-window-exceeded-2025-08-26"`6162 - `"skills-2025-10-02"`6364 - `"fast-mode-2026-02-01"`6566 - `"output-300k-2026-03-24"`6768 - `"user-profiles-2026-03-24"`6970 - `"user-profiles-2026-08-18"`7172 - `"user-profiles-2026-09-04"`7374 - `"advisor-tool-2026-03-01"`7576 - `"managed-agents-2026-04-01"`7778 - `"cache-diagnosis-2026-04-07"`7980 - `"dreaming-2026-04-21"`8182 - `"thinking-token-count-2026-05-13"`8384 - `"server-side-fallback-2026-06-01"`8586 - `"server-side-fallback-2026-07-01"`8788 - `"fallback-credit-2026-06-01"`8990 - `"fallback-credit-2026-07-01"`9192 - `"agent-memory-2026-07-22"`9394 - `"mid-conversation-tool-changes-2026-07-01"`9596 - `"compact-2026-01-12"`9798 - `"computer-use-2025-11-24"`99100 - `"mcp-tunnels-2026-06-22"`101102 - `"structured-outputs-2025-11-13"`103104 - `"task-budgets-2026-03-13"`105106 - `"thinking-display-updates-2026-08-18"`107108 - `"ce-user-management-2026-07-13"`109110 - `"mid-conversation-output-config-2026-07-01"`111112 - `"thinking-binding-controls-2026-08-01"`113114 - `"mid-conversation-system-clear-at-2026-08-21"`115116 - `"compact-2026-09-04"`117118- `"anthropic-workspace-id": optional string`119120## Returns121122- `BetaSelfHostedWorkQueueStats object`123124 Statistics about the work queue for an environment.125126 Uses Redis Stream consumer group metrics for O(1) queries.127128 - `type: "work_queue_stats"`129130 The type of object131132 default: work_queue_stats133134 - `depth: number`135136 Number of work items waiting to be picked up (lag from consumer group)137138 - `oldest_queued_at: string or null`139140 RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty141142 - `pending: number`143144 Number of work items being processed (polled but not acknowledged)145146 default: 0147148 - `workers_polling: number or null`149150 Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.151152## Example153154```bash155curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/stats \156 -H 'anthropic-version: 2023-06-01' \157 -H 'anthropic-beta: managed-agents-2026-04-01' \158 -H "X-Api-Key: $ANTHROPIC_API_KEY"159```160161### Response (200)162163```json164{165 "depth": 0,166 "oldest_queued_at": "oldest_queued_at",167 "pending": 0,168 "type": "work_queue_stats",169 "workers_polling": 0170}171```172