{"openapi": "3.1.0", "info": {"title": "\u4e7e\u5764\u888b \u667a\u80fd\u4f53\u63a5\u5165 API", "version": "1", "summary": "\u667a\u80fd\u4f53\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u3001\u53ef\u4fe1\u6267\u884c\u7684\u5de5\u5177\u5c42\u3002"}, "servers": [{"url": "https://tools.k6-12.com"}], "x-operation-catalog": "https://tools.k6-12.com/api/catalog/operations", "security": [], "paths": {"/api/auth/register/": {"post": {"summary": "\u6ce8\u518c\u5e76\u83b7\u53d6\u4f1a\u8bdd\u4ee4\u724c", "tags": ["auth"], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["username", "password"], "properties": {"username": {"type": "string"}, "password": {"type": "string"}}}}}}, "responses": {"201": {"description": "\u6ce8\u518c\u6210\u529f", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "400": {"description": "\u53c2\u6570\u4e0d\u5408\u6cd5", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/auth/login/password/": {"post": {"summary": "\u5bc6\u7801\u767b\u5f55", "tags": ["auth"], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["identifier", "password"], "properties": {"identifier": {"type": "string"}, "password": {"type": "string"}}}}}}, "responses": {"200": {"description": "\u767b\u5f55\u6210\u529f", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "401": {"description": "\u51ed\u8bc1\u9519\u8bef", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tools/": {"get": {"summary": "\u5217\u51fa\u5de5\u5177\uff08\u516c\u5171\uff0c\u5de5\u5177\u4f18\u5148\u53d1\u73b0\u7684\u8d77\u70b9\uff09", "tags": ["catalog"], "parameters": [{"name": "channel", "in": "query", "schema": {"type": "string", "enum": ["web", "mcp", "app", "all"], "default": "web"}, "description": "all \u8868\u793a\u4e0d\u6309\u6e20\u9053\u8fc7\u6ee4\uff08\u667a\u80fd\u4f53\u53d1\u73b0\u7528\uff09"}, {"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "tags", "in": "query", "schema": {"type": "string"}}, {"name": "access_level", "in": "query", "schema": {"type": "string", "enum": ["free", "registered", "paid"]}}, {"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1, "default": 1}}, {"name": "page_size", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 200}}], "responses": {"200": {"description": "\u5de5\u5177\u5217\u8868", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object", "properties": {"tools": {"type": "array", "items": {"type": "object"}}, "total": {"type": "integer"}, "page": {"type": "integer"}, "pageSize": {"type": "integer"}}}}}}}}}}}, "/api/catalog/operations": {"get": {"summary": "\u5217\u51fa\u53ef\u8c03\u7528\u64cd\u4f5c\uff08\u516c\u5171\uff09", "tags": ["catalog"], "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "toolCode", "in": "query", "schema": {"type": "string"}, "description": "\u53ea\u8fd4\u56de\u8be5\u5de5\u5177\u7684\u64cd\u4f5c\uff1b\u9009\u4e2d\u5de5\u5177\u540e\u7684\u7b2c\u4e8c\u6b65"}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 50, "default": 20}}], "responses": {"200": {"description": "\u64cd\u4f5c\u5217\u8868", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object", "properties": {"items": {"type": "array", "items": {"type": "object"}}, "total": {"type": "integer"}, "nextCursor": {"type": ["string", "null"]}, "query": {"type": "string"}, "toolCode": {"type": "string"}}}}}}}}}}}, "/api/catalog/operations/{operationId}/": {"get": {"summary": "\u5355\u4e2a\u64cd\u4f5c\u7684\u5b8c\u6574\u63cf\u8ff0", "tags": ["catalog"], "parameters": [{"name": "operationId", "in": "path", "required": true, "schema": {"type": "string"}, "example": "ocr-recognize"}], "responses": {"200": {"description": "\u64cd\u4f5c\u63cf\u8ff0", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "404": {"description": "\u64cd\u4f5c\u4e0d\u5b58\u5728", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/catalog/operations/{operationId}/schema": {"get": {"summary": "\u64cd\u4f5c\u7684\u8f93\u5165/\u8f93\u51fa JSON Schema", "tags": ["catalog"], "parameters": [{"name": "operationId", "in": "path", "required": true, "schema": {"type": "string"}, "example": "ocr-recognize"}, {"name": "direction", "in": "query", "schema": {"type": "string", "enum": ["input", "output"], "default": "input"}}], "responses": {"200": {"description": "JSON Schema", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "404": {"description": "\u64cd\u4f5c\u6216\u8f93\u51fa schema \u4e0d\u5b58\u5728", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/me/capabilities/": {"get": {"summary": "\u5f53\u524d\u51ed\u8bc1\u7684\u6388\u6743\u3001\u914d\u989d\u4e0e\u9884\u7b97\uff08\u79c1\u6709\uff09", "tags": ["catalog"], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "\u80fd\u529b\u89c6\u56fe", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "401": {"description": "\u51ed\u8bc1\u65e0\u6548", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tools/{code}/": {"get": {"summary": "\u5de5\u5177\u5143\u6570\u636e\uff08\u7f51\u9875\u6e32\u67d3\u7528\uff09", "tags": ["tools"], "parameters": [{"name": "code", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "\u5de5\u5177\u8be6\u60c5", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}}}, "post": {"summary": "\u540c\u6b65\u6267\u884c\u64cd\u4f5c\uff08\u53c2\u6570\u6309\u64cd\u4f5c schema\uff09", "tags": ["tools"], "parameters": [{"name": "code", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 128}, "description": "\u8d85\u65f6\u91cd\u8bd5\u5e26\u540c\u4e00\u4e2a\u952e\uff0c\u670d\u52a1\u7aef\u53ea\u6267\u884c\u4e00\u6b21\u5e76\u56de\u653e\u56de\u6267"}], "security": [{"bearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "description": "\u7cbe\u786e\u5165\u53c2\u89c1\u76ee\u5f55\u91cc\u8be5\u64cd\u4f5c\u7684 inputSchema"}}}}, "responses": {"200": {"description": "\u6267\u884c\u7ed3\u679c\u6216\u7edf\u4e00\u56de\u6267", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "400": {"description": "\u53c2\u6570\u6216\u8d44\u6e90\u4e0d\u5408\u6cd5", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "403": {"description": "\u51ed\u8bc1\u65e0\u6b64\u64cd\u4f5c\u6743\u9650", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "409": {"description": "\u5e42\u7b49\u952e\u51b2\u7a81\u6216\u64cd\u4f5c\u8fdb\u884c\u4e2d", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tools/{code}/quote/": {"post": {"summary": "\u8ba1\u8d39\u9884\u6f14\uff08\u4e0d\u9884\u6263\u3001\u4e0d\u6267\u884c\uff09", "tags": ["tools"], "parameters": [{"name": "code", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "\u9884\u4f30\u4ef7", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}}}}, "/api/jobs/{code}/": {"post": {"summary": "\u63d0\u4ea4\u5f02\u6b65\u64cd\u4f5c", "tags": ["tasks"], "parameters": [{"name": "code", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 128}, "description": "\u8d85\u65f6\u91cd\u8bd5\u5e26\u540c\u4e00\u4e2a\u952e\uff0c\u670d\u52a1\u7aef\u53ea\u6267\u884c\u4e00\u6b21\u5e76\u56de\u653e\u56de\u6267"}], "security": [{"bearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "description": "\u7cbe\u786e\u5165\u53c2\u89c1\u64cd\u4f5c inputSchema"}}}}, "responses": {"202": {"description": "\u5df2\u53d7\u7406", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"$ref": "#/components/schemas/Receipt"}}}}}}, "400": {"description": "\u53c2\u6570\u6216\u8d44\u6e90\u4e0d\u5408\u6cd5", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "409": {"description": "\u5e42\u7b49\u952e\u51b2\u7a81", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tasks/{taskRef}/": {"get": {"summary": "\u4efb\u52a1\u72b6\u6001\u4e0e\u4ea7\u7269\u5f15\u7528", "tags": ["tasks"], "parameters": [{"name": "taskRef", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^tool:[0-9a-fA-F-]{36}$"}, "example": "tool:8f0c1b5e-2a4d-4c1e-9f00-123456789abc"}], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "\u4efb\u52a1\u8be6\u60c5", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"$ref": "#/components/schemas/Task"}}}}}}, "401": {"description": "\u672a\u643a\u5e26\u51ed\u8bc1", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "\u4efb\u52a1\u4e0d\u5b58\u5728\u6216\u4e0d\u5c5e\u4e8e\u8be5\u51ed\u8bc1", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tasks/{taskRef}/wait/": {"get": {"summary": "\u957f\u8f6e\u8be2\u7b49\u5f85\uff08\u4e0a\u9650 30 \u79d2\uff09", "tags": ["tasks"], "parameters": [{"name": "taskRef", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^tool:[0-9a-fA-F-]{36}$"}, "example": "tool:8f0c1b5e-2a4d-4c1e-9f00-123456789abc"}, {"name": "timeout", "in": "query", "schema": {"type": "number", "minimum": 1, "maximum": 30, "default": 25}}], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "\u7ec8\u6001\u3001requires_action \u6216\u8d85\u65f6", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"$ref": "#/components/schemas/Task"}}}}}}, "401": {"description": "\u672a\u643a\u5e26\u51ed\u8bc1", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/tasks/{taskRef}/result": {"get": {"summary": "\u8bfb\u53d6\u4efb\u52a1\u5b8c\u6574\u7ed3\u679c\uff08\u5927\u7ed3\u679c\u5165\u53e3\uff09", "tags": ["tasks"], "parameters": [{"name": "taskRef", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^tool:[0-9a-fA-F-]{36}$"}, "example": "tool:8f0c1b5e-2a4d-4c1e-9f00-123456789abc"}], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "\u5b8c\u6574\u7ed3\u679c", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}, "409": {"description": "\u4efb\u52a1\u672a\u5230\u7ec8\u6001", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/files/{fileId}/content/": {"get": {"summary": "\u8bfb\u53d6\u4ea7\u7269\u5b57\u8282\uff08\u8ba4\u8bc1\u4ee3\u7406\uff0c\u4e0d\u8fd4\u56de\u53ef\u8f6c\u624b URL\uff09", "tags": ["files"], "parameters": [{"name": "fileId", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "\u6587\u4ef6\u5b57\u8282\u6d41"}, "404": {"description": "\u6587\u4ef6\u4e0d\u5b58\u5728\u6216\u4e0d\u5c5e\u4e8e\u8be5\u51ed\u8bc1", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/keys/": {"get": {"summary": "\u5217\u51fa\u8d26\u6237\u7684 API Key\uff08\u4ec5\u4f1a\u8bdd\u51ed\u8bc1\uff09", "tags": ["account"], "security": [{"bearerAuth": []}], "responses": {"200": {"description": "Key \u5217\u8868", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}}}, "post": {"summary": "\u7b7e\u53d1 API Key\uff08\u4ec5\u4f1a\u8bdd\u51ed\u8bc1\uff09", "tags": ["account"], "security": [{"bearerAuth": []}], "responses": {"201": {"description": "Key \u4e0e\u4e00\u6b21\u6027\u660e\u6587", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "data"], "properties": {"ok": {"type": "boolean", "const": true}, "data": {"type": "object"}}}}}}}}}}, "components": {"securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer", "description": "\u4f1a\u8bdd\u4ee4\u724c\uff08\u975e tk_ \u524d\u7f00\uff09\u6216 API Key\uff08tk_ \u524d\u7f00\uff09"}}, "schemas": {"Receipt": {"type": "object", "required": ["operationId", "runId", "status"], "properties": {"operationId": {"type": "string"}, "runId": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["executing", "accepted", "requires_action", "succeeded", "failed", "cancelled", "expired"]}, "taskRef": {"type": ["string", "null"]}, "links": {"type": "object", "properties": {"status": {"type": "string"}, "wait": {"type": "string"}, "result": {"type": "string"}}}, "result": {}, "outputs": {"type": "array", "items": {"$ref": "#/components/schemas/ResourceRef"}}, "replayed": {"type": "boolean"}}}, "Task": {"type": "object", "required": ["taskRef", "status", "terminal"], "properties": {"taskRef": {"type": "string"}, "operationId": {"type": "string"}, "runId": {"type": ["string", "null"]}, "status": {"type": "string"}, "sourceStatus": {"type": "string"}, "terminal": {"type": "boolean"}, "pollAfterSeconds": {"type": ["integer", "null"]}, "result": {}, "resultOmitted": {"type": "boolean"}, "outputs": {"type": "array", "items": {"$ref": "#/components/schemas/ResourceRef"}}, "pendingAction": {"type": ["object", "null"]}, "links": {"type": "object"}, "timedOut": {"type": "boolean"}}}, "ResourceRef": {"type": "object", "required": ["kind", "id"], "properties": {"kind": {"type": "string", "examples": ["stored-file"]}, "id": {"type": "string"}, "mime": {"type": "string"}, "bytes": {"type": "integer"}, "revision": {"type": "integer"}, "sha256": {"type": "string"}, "expiresAt": {"type": "string", "format": "date-time"}, "readWith": {"type": "object", "properties": {"method": {"type": "string"}, "path": {"type": "string"}}}}}, "ErrorResponse": {"type": "object", "required": ["ok", "error"], "properties": {"ok": {"type": "boolean", "const": false}, "error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "field": {"type": "string"}, "allowed": {"type": "array", "items": {}}, "retryAfterSeconds": {"type": "number"}, "traceId": {"type": "string"}, "remediation": {"type": "object", "properties": {"description": {"type": "string"}, "operationId": {"type": "string"}, "url": {"type": "string"}}}}}}}}}}