{ "openapi": "3.1.0", "info": { "title": "AetherHub API", "description": "AetherHub - 大模型技能管理平台 API", "version": "1.0.0" }, "paths": { "/api/v1/auth/login": { "get": { "tags": [ "auth" ], "summary": "Login", "description": "获取 GitHub OAuth 授权 URL", "operationId": "login_api_v1_auth_login_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/auth/callback": { "get": { "tags": [ "auth" ], "summary": "Callback Legacy", "description": "Legacy /auth/callback — same as /callback/github for back-compat.", "operationId": "callback_legacy_api_v1_auth_callback_get", "parameters": [ { "name": "code", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Code" } }, { "name": "state", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "State" } }, { "name": "error", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/mock-callback": { "get": { "tags": [ "auth" ], "summary": "Mock Callback", "description": "Mock 模式回调(无需真实 GitHub OAuth)", "operationId": "mock_callback_api_v1_auth_mock_callback_get", "parameters": [ { "name": "state", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "State" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/refresh": { "post": { "tags": [ "auth" ], "summary": "Refresh Token", "description": "刷新访问令牌(使用刷新令牌获取新的访问令牌)", "operationId": "refresh_token_api_v1_auth_refresh_post", "parameters": [ { "name": "refresh_token", "in": "query", "required": true, "schema": { "type": "string", "title": "Refresh Token" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/me": { "get": { "tags": [ "auth" ], "summary": "Me", "description": "获取当前登录用户信息", "operationId": "me_api_v1_auth_me_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/logout": { "post": { "tags": [ "auth" ], "summary": "Logout", "description": "登出(前端清除 token,后端无状态)", "operationId": "logout_api_v1_auth_logout_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/providers": { "get": { "tags": [ "auth" ], "summary": "List Providers", "description": "List enabled providers for the login page UI.", "operationId": "list_providers_api_v1_auth_providers_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/auth/login/{provider_slug}": { "get": { "tags": [ "auth" ], "summary": "Login With Provider", "description": "Start OAuth/OIDC flow for the given provider.", "operationId": "login_with_provider_api_v1_auth_login__provider_slug__get", "parameters": [ { "name": "provider_slug", "in": "path", "required": true, "schema": { "type": "string", "title": "Provider Slug" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/auth/callback/{provider_slug}": { "get": { "tags": [ "auth" ], "summary": "Callback For Provider", "description": "OIDC / GitHub callback for a specific provider.", "operationId": "callback_for_provider_api_v1_auth_callback__provider_slug__get", "parameters": [ { "name": "provider_slug", "in": "path", "required": true, "schema": { "type": "string", "title": "Provider Slug" } }, { "name": "code", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Code" } }, { "name": "state", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "State" } }, { "name": "error", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills": { "get": { "tags": [ "skills" ], "summary": "List Skills", "description": "获取公开技能列表(支持 cursor 或 offset 分页)", "operationId": "list_skills_api_v1_skills_get", "parameters": [ { "name": "q", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Q" } }, { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } }, { "name": "tags", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tags" } }, { "name": "sort", "in": "query", "required": false, "schema": { "type": "string", "default": "created_at", "title": "Sort" } }, { "name": "order", "in": "query", "required": false, "schema": { "type": "string", "default": "desc", "title": "Order" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "cursor", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "skills" ], "summary": "Create Skill", "description": "上传新技能(需鉴权)", "operationId": "create_skill_api_v1_skills_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_create_skill_api_v1_skills_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/categories": { "get": { "tags": [ "skills" ], "summary": "List Categories", "description": "获取分类列表及数量", "operationId": "list_categories_api_v1_skills_categories_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/skills/search": { "get": { "tags": [ "skills" ], "summary": "Search Skills", "description": "混合搜索:结合 FTS5 关键词搜索 + 向量语义搜索,使用 RRF 融合\n\n- q: 搜索查询字符串\n- category: 可选分类过滤\n- tags: 可选标签过滤(逗号分隔)\n- sort: relevance | star_count | created_at(默认 relevance 使用 RRF 融合)\n- page, size, cursor: 分页参数(cursor 优先)", "operationId": "search_skills_api_v1_skills_search_get", "parameters": [ { "name": "q", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "title": "Q" } }, { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } }, { "name": "tags", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tags" } }, { "name": "sort", "in": "query", "required": false, "schema": { "type": "string", "default": "relevance", "title": "Sort" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "cursor", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/mine": { "get": { "tags": [ "skills" ], "summary": "My Skills", "description": "获取我的技能列表(需鉴权)", "operationId": "my_skills_api_v1_skills_mine_get", "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}": { "get": { "tags": [ "skills" ], "summary": "Get Skill", "description": "获取技能详情", "operationId": "get_skill_api_v1_skills__skill_id__get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "skills" ], "summary": "Delete Skill", "description": "删除技能(需鉴权,仅限作者)", "operationId": "delete_skill_api_v1_skills__skill_id__delete", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/files/{filename}": { "get": { "tags": [ "skills" ], "summary": "Get Skill File", "description": "获取技能文件内容", "operationId": "get_skill_file_api_v1_skills__skill_id__files__filename__get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "filename", "in": "path", "required": true, "schema": { "type": "string", "title": "Filename" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/star": { "post": { "tags": [ "skills" ], "summary": "Star Skill", "description": "Star 技能(可选带评分 1-10)", "operationId": "star_skill_api_v1_skills__skill_id__star_post", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_star_skill_api_v1_skills__skill_id__star_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "skills" ], "summary": "Unstar Skill", "description": "取消 Star", "operationId": "unstar_skill_api_v1_skills__skill_id__star_delete", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/ratings": { "get": { "tags": [ "skills" ], "summary": "Get Skill Ratings", "description": "获取技能评分统计", "operationId": "get_skill_ratings_api_v1_skills__skill_id__ratings_get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/versions": { "get": { "tags": [ "skills" ], "summary": "List Skill Versions", "description": "获取技能版本历史", "operationId": "list_skill_versions_api_v1_skills__skill_id__versions_get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "skills" ], "summary": "Create Skill Version", "description": "创建新技能版本(需鉴权,仅限作者)", "operationId": "create_skill_version_api_v1_skills__skill_id__versions_post", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_create_skill_version_api_v1_skills__skill_id__versions_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/versions/{version}": { "get": { "tags": [ "skills" ], "summary": "Get Skill Version", "description": "获取技能特定版本详情", "operationId": "get_skill_version_api_v1_skills__skill_id__versions__version__get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "version", "in": "path", "required": true, "schema": { "type": "string", "title": "Version" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "skills" ], "summary": "Delete Skill Version", "description": "删除指定版本(仅限作者)", "operationId": "delete_skill_version_api_v1_skills__skill_id__versions__version__delete", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "version", "in": "path", "required": true, "schema": { "type": "string", "title": "Version" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/versions/{version}/restore": { "post": { "tags": [ "skills" ], "summary": "Restore Skill Version", "description": "恢复旧版本为新版本(仅限作者)", "operationId": "restore_skill_version_api_v1_skills__skill_id__versions__version__restore_post", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "version", "in": "path", "required": true, "schema": { "type": "string", "title": "Version" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/versions/diff": { "get": { "tags": [ "skills" ], "summary": "Diff Skill Versions", "description": "对比两个版本的代码差异", "operationId": "diff_skill_versions_api_v1_skills__skill_id__versions_diff_get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } }, { "name": "v1", "in": "query", "required": true, "schema": { "type": "string", "description": "第一个版本号", "title": "V1" }, "description": "第一个版本号" }, { "name": "v2", "in": "query", "required": true, "schema": { "type": "string", "description": "第二个版本号", "title": "V2" }, "description": "第二个版本号" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/{skill_id}/analytics": { "get": { "tags": [ "skills" ], "summary": "Get Skill Analytics", "description": "获取技能分析数据", "operationId": "get_skill_analytics_api_v1_skills__skill_id__analytics_get", "parameters": [ { "name": "skill_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Skill Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/skills/analytics/leaderboard": { "get": { "tags": [ "skills" ], "summary": "Get Leaderboard", "description": "获取技能排行榜", "operationId": "get_leaderboard_api_v1_skills_analytics_leaderboard_get", "parameters": [ { "name": "period", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^(week|month|all)$", "default": "week", "title": "Period" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 10, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/a2a/skill-request": { "post": { "tags": [ "a2a" ], "summary": "Request Skill", "description": "A2A Skill Request Endpoint\n\nAgents can request a skill capability and receive:\n- Skill metadata\n- How to execute the skill\n\nThis is a simple A2A protocol for agent-to-agent communication.", "operationId": "request_skill_api_v1_a2a_skill_request_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SkillRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/a2a/capabilities": { "get": { "tags": [ "a2a" ], "summary": "List Capabilities", "description": "List all unique capabilities (categories + tags) available in the marketplace.\nUseful for agents to discover what skills are available.", "operationId": "list_capabilities_api_v1_a2a_capabilities_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/audit": { "get": { "tags": [ "audit" ], "summary": "List Audit Logs", "description": "获取审计日志列表(仅管理员)", "operationId": "list_audit_logs_api_v1_audit_get", "parameters": [ { "name": "cursor", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor" } }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Size" } }, { "name": "action", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Action" } }, { "name": "user_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "User Id" } }, { "name": "resource_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resource Type" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/templates": { "get": { "tags": [ "templates" ], "summary": "List Templates", "description": "获取可用技能模板列表", "operationId": "list_templates_api_v1_templates_get", "parameters": [ { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/templates/{template_id}": { "get": { "tags": [ "templates" ], "summary": "Get Template", "description": "获取模板详情", "operationId": "get_template_api_v1_templates__template_id__get", "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Template Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/templates/{template_id}/clone": { "post": { "tags": [ "templates" ], "summary": "Clone Template", "description": "克隆模板到用户的技能", "operationId": "clone_template_api_v1_templates__template_id__clone_post", "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Template Id" } }, { "name": "name", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/users/me": { "get": { "tags": [ "users" ], "summary": "Get My Profile", "description": "Get current user profile", "operationId": "get_my_profile_api_v1_users_me_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "tags": [ "users" ], "summary": "Update My Profile", "description": "Update current user profile", "operationId": "update_my_profile_api_v1_users_me_put", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserProfileUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/users/me/stats": { "get": { "tags": [ "users" ], "summary": "Get My Stats", "description": "Get current user stats (skills created, stars received, etc)", "operationId": "get_my_stats_api_v1_users_me_stats_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/users/{user_id}": { "get": { "tags": [ "users" ], "summary": "Get User Profile", "description": "Get any user public profile", "operationId": "get_user_profile_api_v1_users__user_id__get", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/users/{user_id}/skills": { "get": { "tags": [ "users" ], "summary": "Get User Skills", "description": "Get public skills by a user", "operationId": "get_user_skills_api_v1_users__user_id__skills_get", "parameters": [ { "name": "user_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "User Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/rtk/analytics": { "get": { "tags": [ "rtk" ], "summary": "Get Rtk Analytics", "description": "Get RTK token savings analytics.\nCalls `rtk gain --format json --all` and returns structured data.", "operationId": "get_rtk_analytics_api_v1_rtk_analytics_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/rtk/discover": { "get": { "tags": [ "rtk" ], "summary": "Discover Missed Opportunities", "description": "Get RTK discovered missed opportunities.\nCalls `rtk discover --format json` and returns suggestions.", "operationId": "discover_missed_opportunities_api_v1_rtk_discover_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/v1/github/import": { "get": { "tags": [ "github" ], "summary": "Github Search Import", "description": "搜索 GitHub repos 并导入为技能", "operationId": "github_search_import_api_v1_github_import_get", "parameters": [ { "name": "q", "in": "query", "required": true, "schema": { "type": "string", "title": "Q" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 10, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/github/import/{owner}/{repo}": { "post": { "tags": [ "github" ], "summary": "Github Import Repo", "description": "导入指定 repo 为技能\n\n临时实现 (TODO): 目前会接受请求但 *不* 真的写库。\n真正的实现需要 GitHub API 内容拉取 + README/SKILL.md 解析 +\nSkill/SkillFile 模型写入 + Storage 上传。在没做完之前这个 endpoint\n返回 501,以便前端/CLI 能看到缺这功能,而不是假成功。", "operationId": "github_import_repo_api_v1_github_import__owner___repo__post", "parameters": [ { "name": "owner", "in": "path", "required": true, "schema": { "type": "string", "title": "Owner" } }, { "name": "repo", "in": "path", "required": true, "schema": { "type": "string", "title": "Repo" } }, { "name": "db", "in": "query", "required": false, "schema": { "title": "Db" } }, { "name": "current_user", "in": "query", "required": false, "schema": { "title": "Current User" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/": { "get": { "summary": "Root", "operationId": "root__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/health": { "get": { "summary": "Health", "operationId": "health_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } } }, "components": { "schemas": { "Body_create_skill_api_v1_skills_post": { "properties": { "name": { "type": "string", "title": "Name" }, "version": { "type": "string", "title": "Version" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" }, "tags": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Tags", "default": "[]" }, "files": { "items": { "type": "string", "contentMediaType": "application/octet-stream" }, "type": "array", "title": "Files" } }, "type": "object", "required": [ "name", "version", "files" ], "title": "Body_create_skill_api_v1_skills_post" }, "Body_create_skill_version_api_v1_skills__skill_id__versions_post": { "properties": { "version": { "type": "string", "title": "Version" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "version" ], "title": "Body_create_skill_version_api_v1_skills__skill_id__versions_post" }, "Body_star_skill_api_v1_skills__skill_id__star_post": { "properties": { "rating": { "anyOf": [ { "type": "integer", "maximum": 10.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Rating" } }, "type": "object", "title": "Body_star_skill_api_v1_skills__skill_id__star_post" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "SkillRequest": { "properties": { "capability": { "type": "string", "title": "Capability" }, "params": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Params" }, "preferred_category": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Preferred Category" } }, "type": "object", "required": [ "capability" ], "title": "SkillRequest", "description": "A2A skill request payload" }, "UserProfileUpdate": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "bio": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Bio" } }, "type": "object", "title": "UserProfileUpdate" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } } } }