{
  "openapi": "3.0.3",
  "info": {
    "title": "BrainDataOS Label Extraction API",
    "version": "v1",
    "description": "把脑电实验的任务描述解析成结构化标签（task / labels / label_type / confidence）。规则引擎与 BrainDataOS 标签抽取 Agent 同一套口径。"
  },
  "servers": [
    {
      "url": "https://brainos.bigmonsterclaw.com/developer/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "bdos_live_ 开头的密钥"
      }
    }
  },
  "paths": {
    "/labels/extract": {
      "post": {
        "summary": "单条描述抽取标签",
        "operationId": "extractLabels",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "participant performs left/right hand motor imagery"
                  },
                  "min_confidence": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "抽取成功"
          },
          "401": {
            "description": "密钥缺失/无效"
          },
          "429": {
            "description": "配额耗尽或限流"
          }
        }
      }
    },
    "/labels/extract/batch": {
      "post": {
        "summary": "批量抽取（最多 50 条，计 1 次配额）",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "批次结果 + 类别分布"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "summary": "查询本密钥配额与调用量",
        "responses": {
          "200": {
            "description": "用量"
          }
        }
      }
    },
    "/rules": {
      "get": {
        "summary": "规则表（公开，无需密钥）",
        "security": [],
        "responses": {
          "200": {
            "description": "全部匹配规则"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "存活探针",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    }
  }
}