{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/anthropic/main/json-schema/anthropic-beta-self-hosted-work-queue-stats-schema.json",
  "title": "SelfHostedWorkQueueStats",
  "description": "Statistics about the work queue for an environment.\n\nUses Redis Stream consumer group metrics for O(1) queries.",
  "x-generated": "2026-09-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anthropic-environments-api-openapi.yml#/components/schemas/BetaSelfHostedWorkQueueStats",
  "properties": {
    "depth": {
      "type": "integer",
      "title": "Depth",
      "description": "Number of work items waiting to be picked up (lag from consumer group)"
    },
    "oldest_queued_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Oldest Queued At",
      "description": "RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty"
    },
    "pending": {
      "type": "integer",
      "title": "Pending",
      "description": "Number of work items being processed (polled but not acknowledged)",
      "default": 0
    },
    "type": {
      "type": "string",
      "const": "work_queue_stats",
      "title": "Type",
      "description": "The type of object",
      "default": "work_queue_stats"
    },
    "workers_polling": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workers Polling",
      "description": "Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests."
    }
  },
  "type": "object",
  "required": [
    "depth",
    "oldest_queued_at",
    "pending",
    "type",
    "workers_polling"
  ]
}