{
  "openapi": "3.1.0",
  "info": {
    "title": "全球实时视频流预览 API",
    "version": "1.0.0",
    "description": "提供公开 HLS 与 MP4 测试视频流目录的只读查询接口。"
  },
  "servers": [
    {
      "url": "https://free-rtsp.pages.dev"
    }
  ],
  "paths": {
    "/api/streams.json": {
      "get": {
        "operationId": "listStreams",
        "summary": "获取全部公开视频流清单",
        "responses": {
          "200": {
            "description": "视频流清单 JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "directCount": { "type": "integer" },
                    "proxyCount": { "type": "integer" },
                    "streams": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "integer" },
                          "name": { "type": "string" },
                          "url": { "type": "string", "format": "uri" },
                          "type": { "type": "string", "enum": ["hls", "mp4"] },
                          "proxy": { "type": "boolean" },
                          "cover": { "type": "string" }
                        },
                        "required": ["id", "name", "url", "type", "proxy", "cover"]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "healthCheck",
        "summary": "服务健康检查",
        "responses": {
          "200": {
            "description": "健康状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "streams": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
