{"openapi":"3.0.3","info":{"title":"newbee6688 API","version":"1.0.0","description":"开发者 API（预览）。每密钥每 UTC 自然日调用上限默认为 10000（环境变量 `API_DAILY_LIMIT_PER_KEY`）。"},"servers":[{"url":"https://newbee6688.com"}],"tags":[{"name":"v1","description":"API v1 示例与状态接口"}],"paths":{"/api/v1/echo":{"get":{"tags":["v1"],"summary":"Echo（消耗配额）","description":"校验 API Key 并返回成功信息；**计入**当日配额（与审计日志）。","security":[{"BearerAuth":[]},{"ApiKeyHeader":[]}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EchoResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/QuotaExceeded"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/api/v1/status":{"get":{"tags":["v1"],"summary":"Status（不消耗配额）","description":"校验 API Key 并返回当前 UTC 日用量；不计入配额，因此不会因当日额度用尽而返回 429。","security":[{"BearerAuth":[]},{"ApiKeyHeader":[]}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"值为完整 API Key，例如 `sk_live_...`"},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"完整 API Key 字符串"}},"schemas":{"Usage":{"type":"object","properties":{"dailyCount":{"type":"integer"},"dailyLimit":{"type":"integer"}}},"EchoResponse":{"type":"object","properties":{"ok":{"type":"boolean","example":true},"version":{"type":"string","example":"v1"},"endpoint":{"type":"string","example":"echo"},"userId":{"type":"string"},"message":{"type":"string"},"usage":{"$ref":"#/components/schemas/Usage"}}},"StatusResponse":{"type":"object","properties":{"ok":{"type":"boolean","example":true},"version":{"type":"string","example":"v1"},"endpoint":{"type":"string","example":"status"},"userId":{"type":"string"},"usage":{"$ref":"#/components/schemas/Usage"}}},"ErrorBody":{"type":"object","properties":{"error":{"type":"string","enum":["unauthorized","quota_exceeded","server_error"]},"limit":{"type":"integer","description":"仅 quota_exceeded 时可能出现"}}}},"responses":{"Unauthorized":{"description":"未提供密钥、格式错误或密钥无效/已撤销","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"},"example":{"error":"unauthorized"}}}},"QuotaExceeded":{"description":"当日配额已用尽（UTC）","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"},"example":{"error":"quota_exceeded","limit":10000}}}},"ServerError":{"description":"服务端错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"},"example":{"error":"server_error"}}}}}}}