{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API for Acontext.", "title": "Acontext API", "contact": {}, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/disk": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all disks under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "List disks", "parameters": [ { "type": "integer", "description": "Limit of disks to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "boolean", "example": false, "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListDisksOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List disks\ndisks = client.disks.list(limit=10, time_desc=True)\nfor disk in disks.items:\n print(f\"Disk: {disk.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List disks\nconst disks = await client.disks.list({ limit: 10, timeDesc: true });\nfor (const disk of disks.items) {\n console.log(`Disk: ${disk.id}`);\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a disk group under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "Create disk", "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Disk" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Create a disk\ndisk = client.disks.create()\nprint(f\"Created disk: {disk.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Create a disk\nconst disk = await client.disks.create();\nconsole.log(`Created disk: ${disk.id}`);\n" } ] } }, "/disk/{disk_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a disk by its UUID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "Delete disk", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Delete a disk\nclient.disks.delete(disk_id='disk-uuid')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a disk\nawait client.disks.delete('disk-uuid');\n" } ] } }, "/disk/{disk_id}/artifact": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get artifact information by path and filename. Optionally include a presigned URL for downloading and parsed file content.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Get artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path including filename", "name": "file_path", "in": "query", "required": true }, { "type": "boolean", "description": "Whether to return public URL, default is true", "name": "with_public_url", "in": "query" }, { "type": "boolean", "description": "Whether to return parsed file content, default is true", "name": "with_content", "in": "query" }, { "type": "integer", "description": "Expire time in seconds for presigned URL (default: 3600)", "name": "expire", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.GetArtifactResp" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an artifact's metadata (user-defined metadata only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Update artifact meta", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "description": "File path including filename", "name": "file_path", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "Custom metadata as JSON string (system metadata '__artifact_info__' cannot be modified)", "name": "meta", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.UpdateArtifactResp" } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a file and create or update an artifact record under a disk", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Upsert artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path in the disk storage (optional, defaults to '/')", "name": "file_path", "in": "formData" }, { "type": "file", "description": "File to upload", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Custom metadata as JSON string (optional, system metadata will be stored under '__artifact_info__' key)", "name": "meta", "in": "formData" } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Artifact" } } } ] } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete an artifact by path and filename", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Delete artifact", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "File path including filename", "name": "file_path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } } } }, "/disk/{disk_id}/artifact/ls": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List artifacts in a specific path or all artifacts in a disk", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "List artifacts", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "Path filter (optional, defaults to root '/')", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.ListArtifactsResp" } } } ] } } } } }, "/session": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all sessions under a project, optionally filtered by space_id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get sessions", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID to filter sessions", "name": "space_id", "in": "query" }, { "type": "boolean", "example": false, "description": "Filter sessions not connected to any space (default false)", "name": "not_connected", "in": "query" }, { "type": "integer", "description": "Limit of sessions to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListSessionsOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List sessions\nsessions = client.sessions.list(\n space_id='space-uuid',\n limit=20,\n time_desc=True\n)\nfor session in sessions.items:\n print(f\"{session.id}: {session.space_id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List sessions\nconst sessions = await client.sessions.list({\n spaceId: 'space-uuid',\n limit: 20,\n timeDesc: true\n});\nfor (const session of sessions.items) {\n console.log(`${session.id}: ${session.space_id}`);\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new session under a space", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Create session", "parameters": [ { "description": "CreateSession payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateSessionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Session" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Create a session\nsession = client.sessions.create(\n space_id='space-uuid',\n configs={\"mode\": \"chat\"}\n)\nprint(f\"Created session: {session.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Create a session\nconst session = await client.sessions.create({\n spaceId: 'space-uuid',\n configs: { mode: 'chat' }\n});\nconsole.log(`Created session: ${session.id}`);\n" } ] } }, "/session/{session_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a session by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Delete session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Delete a session\nclient.sessions.delete(session_id='session-uuid')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a session\nawait client.sessions.delete('session-uuid');\n" } ] } }, "/session/{session_id}/configs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get session configs by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get session configs", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Session" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get session configs\nsession = client.sessions.get_configs(session_id='session-uuid')\nprint(session.configs)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get session configs\nconst session = await client.sessions.getConfigs('session-uuid');\nconsole.log(session.configs);\n" } ] }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update session configs by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Update session configs", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "UpdateSessionConfigs payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateSessionConfigsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Update session configs\nclient.sessions.update_configs(\n session_id='session-uuid',\n configs={\"mode\": \"updated-mode\"}\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Update session configs\nawait client.sessions.updateConfigs('session-uuid', {\n configs: { mode: 'updated-mode' }\n});\n" } ] } }, "/session/{session_id}/connect_to_space": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Connect a session to a space by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Connect session to space", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "ConnectToSpace payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ConnectToSpaceReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Connect session to space\nclient.sessions.connect_to_space(\n session_id='session-uuid',\n space_id='space-uuid'\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Connect session to space\nawait client.sessions.connectToSpace('session-uuid', {\n spaceId: 'space-uuid'\n});\n" } ] } }, "/session/{session_id}/flush": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Flush the session buffer for a given session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Flush session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.FlagResponse" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Flush session buffer\nresult = client.sessions.flush(session_id='session-uuid')\nprint(result.status)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Flush session buffer\nconst result = await client.sessions.flush('session-uuid');\nconsole.log(result.status);\n" } ] } }, "/session/{session_id}/messages": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get messages from session. Default format is openai. Can convert to acontext (original) or anthropic format.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get messages from session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "type": "integer", "description": "Limit of messages to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Whether to return asset public url, default is true", "name": "with_asset_public_url", "in": "query" }, { "enum": [ "acontext", "openai", "anthropic" ], "type": "string", "description": "Format to convert messages to: acontext (original), openai (default), anthropic.", "name": "format", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetMessagesOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get messages from session\nmessages = client.sessions.get_messages(\n session_id='session-uuid',\n limit=50,\n format='acontext',\n time_desc=True\n)\nfor message in messages.items:\n print(f\"{message.role}: {message.parts}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get messages from session\nconst messages = await client.sessions.getMessages('session-uuid', {\n limit: 50,\n format: 'acontext',\n timeDesc: true\n});\nfor (const message of messages.items) {\n console.log(`${message.role}: ${JSON.stringify(message.parts)}`);\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Supports JSON and multipart/form-data. In multipart mode: the payload is a JSON string placed in a form field. The format parameter indicates the format of the input message (default: openai, same as GET). The blob field should be a complete message object: for openai, use OpenAI ChatCompletionMessageParam format (with role and content); for anthropic, use Anthropic MessageParam format (with role and content); for acontext (internal), use {role, parts} format.", "consumes": [ "application/json", "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Send message to session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "SendMessage payload (Content-Type: application/json)", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.SendMessageReq" } }, { "type": "string", "description": "SendMessage payload (Content-Type: multipart/form-data)", "name": "payload", "in": "formData" }, { "type": "file", "description": "When uploading files, the field name must correspond to parts[*].file_field.", "name": "file", "in": "formData" } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Message" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\nfrom acontext.messages import build_acontext_message\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Send a message in Acontext format\nmessage = build_acontext_message(role='user', parts=['Hello!'])\nclient.sessions.send_message(\n session_id='session-uuid',\n blob=message,\n format='acontext'\n)\n\n# Send a message in OpenAI format\nopenai_message = {'role': 'user', 'content': 'Hello from OpenAI format!'}\nclient.sessions.send_message(\n session_id='session-uuid',\n blob=openai_message,\n format='openai'\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient, MessagePart } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Send a message in Acontext format\nawait client.sessions.sendMessage(\n 'session-uuid',\n {\n role: 'user',\n parts: [MessagePart.textPart('Hello!')]\n },\n { format: 'acontext' }\n);\n\n// Send a message in OpenAI format\nawait client.sessions.sendMessage(\n 'session-uuid',\n {\n role: 'user',\n content: 'Hello from OpenAI format!'\n },\n { format: 'openai' }\n);\n" } ] } }, "/session/{session_id}/task": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get tasks from session with cursor-based pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "task" ], "summary": "Get tasks from session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "type": "integer", "description": "Limit of tasks to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "boolean", "example": false, "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetTasksOutput" } } } ] } } } } }, "/space": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all spaces under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get spaces", "parameters": [ { "type": "integer", "description": "Limit of spaces to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination. Use the cursor from the previous response to get the next page.", "name": "cursor", "in": "query" }, { "type": "string", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListSpacesOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List spaces\nspaces = client.spaces.list(limit=20, time_desc=True)\nfor space in spaces.items:\n print(f\"{space.id}: {space.configs}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List spaces\nconst spaces = await client.spaces.list({ limit: 20, timeDesc: true });\nfor (const space of spaces.items) {\n console.log(`${space.id}: ${JSON.stringify(space.configs)}`);\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new space under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Create space", "parameters": [ { "description": "CreateSpace payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateSpaceReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Space" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Create a space\nspace = client.spaces.create(configs={\"name\": \"My Space\"})\nprint(f\"Created space: {space.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Create a space\nconst space = await client.spaces.create({ configs: { name: 'My Space' } });\nconsole.log(`Created space: ${space.id}`);\n" } ] } }, "/space/{space_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Delete space", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Delete a space\nclient.spaces.delete(space_id='space-uuid')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a space\nawait client.spaces.delete('space-uuid');\n" } ] } }, "/space/{space_id}/block": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List blocks in a space. Use type query parameter to filter by block type (page, folder, text, sop, etc.). Use parent_id query parameter to filter by parent. If both type and parent_id are empty, returns top-level pages and folders.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "List blocks", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "enum": [ "page", "folder", "text", "sop" ], "type": "string", "description": "Block type", "name": "type", "in": "query" }, { "type": "string", "format": "uuid", "description": "Parent ID", "name": "parent_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Block" } } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List blocks\nblocks = client.blocks.list(\n space_id='space-uuid',\n parent_id='parent-uuid',\n block_type='page'\n)\nfor block in blocks:\n print(f\"{block.id}: {block.title}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List blocks\nconst blocks = await client.blocks.list('space-uuid', {\n parentId: 'parent-uuid',\n type: 'page'\n});\nfor (const block of blocks) {\n console.log(`${block.id}: ${block.title}`);\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new block (supports all types: page, folder, text, sop, etc.). For page and folder types, parent_id is optional. For other types, parent_id is required.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Create block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "description": "CreateBlock payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateBlockReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.InsertBlockResponse" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Create a page\npage = client.blocks.create(\n space_id='space-uuid',\n block_type='page',\n title='My Page'\n)\n\n# Create a text block under the page\ntext_block = client.blocks.create(\n space_id='space-uuid',\n parent_id=page['id'],\n block_type='text',\n title='Content',\n props={\"text\": \"Block content here\"}\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Create a page\nconst page = await client.blocks.create('space-uuid', {\n blockType: 'page',\n title: 'My Page'\n});\n\n// Create a text block under the page\nconst textBlock = await client.blocks.create('space-uuid', {\n parentId: page.id,\n blockType: 'text',\n title: 'Content',\n props: { text: 'Block content here' }\n});\n" } ] } }, "/space/{space_id}/block/{block_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a block by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Delete block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Delete a block\nclient.blocks.delete(space_id='space-uuid', block_id='block-uuid')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a block\nawait client.blocks.delete('space-uuid', 'block-uuid');\n" } ] } }, "/space/{space_id}/block/{block_id}/move": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Move block by updating its parent_id. Works for all block types (page, folder, text, sop, etc.). For page and folder types, parent_id can be null (root level).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Move block", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "MoveBlock payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.MoveBlockReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Move block to a different parent\nclient.blocks.move(\n space_id='space-uuid',\n block_id='block-uuid',\n parent_id='new-parent-uuid'\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Move block to a different parent\nawait client.blocks.move('space-uuid', 'block-uuid', {\n parentId: 'new-parent-uuid'\n});\n" } ] } }, "/space/{space_id}/block/{block_id}/properties": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a block's properties by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Get block properties", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Block" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get block properties\nblock = client.blocks.get_properties(\n space_id='space-uuid',\n block_id='block-uuid'\n)\nprint(f\"{block.title}: {block.props}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get block properties\nconst block = await client.blocks.getProperties('space-uuid', 'block-uuid');\nconsole.log(`${block.title}: ${JSON.stringify(block.props)}`);\n" } ] }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update a block's title and properties by its ID (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Update block properties", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "UpdateBlockProperties payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateBlockPropertiesReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Update block properties\nclient.blocks.update_properties(\n space_id='space-uuid',\n block_id='block-uuid',\n title='Updated Title',\n props={\"text\": \"Updated content\"}\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Update block properties\nawait client.blocks.updateProperties('space-uuid', 'block-uuid', {\n title: 'Updated Title',\n props: { text: 'Updated content' }\n});\n" } ] } }, "/space/{space_id}/block/{block_id}/sort": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update block sort value (works for all block types: page, folder, text, sop, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "block" ], "summary": "Update block sort", "parameters": [ { "type": "string", "format": "uuid", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "description": "Block ID", "name": "block_id", "in": "path", "required": true }, { "description": "UpdateBlockSort payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateBlockSortReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Update block sort order\nclient.blocks.update_sort(\n space_id='space-uuid',\n block_id='block-uuid',\n sort=5\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Update block sort order\nawait client.blocks.updateSort('space-uuid', 'block-uuid', {\n sort: 5\n});\n" } ] } }, "/space/{space_id}/configs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the configurations of a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get space configs", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Space" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get space configs\nspace = client.spaces.get_configs(space_id='space-uuid')\nprint(space.configs)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get space configs\nconst space = await client.spaces.getConfigs('space-uuid');\nconsole.log(space.configs);\n" } ] }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update the configurations of a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Update space configs", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "description": "UpdateConfigs payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateSpaceConfigsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/serializer.Response" } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Update space configs\nclient.spaces.update_configs(\n space_id='space-uuid',\n configs={\"name\": \"Updated Name\", \"description\": \"New description\"}\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Update space configs\nawait client.spaces.updateConfigs('space-uuid', {\n configs: { name: 'Updated Name', description: 'New description' }\n});\n" } ] } }, "/space/{space_id}/experience_search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the experience search results for a given query within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get experience search", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for page/folder titles", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "string", "description": "Search mode: fast or agentic (default fast)", "name": "mode", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "semantic_threshold", "in": "query" }, { "type": "integer", "description": "Maximum number of iterations for agentic search (1-100, default 16)", "name": "max_iterations", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.SpaceSearchResult" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Experience search\nresult = client.spaces.experience_search(\n space_id='space-uuid',\n query='How to implement authentication?',\n limit=10,\n mode='agentic',\n max_iterations=20\n)\nfor block in result.cited_blocks:\n print(f\"{block.title} (distance: {block.distance})\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Experience search\nconst result = await client.spaces.experienceSearch('space-uuid', {\n query: 'How to implement authentication?',\n limit: 10,\n mode: 'agentic',\n maxIterations: 20\n});\nfor (const block of result.cited_blocks) {\n console.log(`${block.title} (distance: ${block.distance})`);\n}\n" } ] } }, "/space/{space_id}/semantic_global": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the semantic global (glob) search results for page/folder titles within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get semantic global", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for page/folder titles", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "threshold", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Semantic global search\nresults = client.spaces.semantic_global(\n space_id='space-uuid',\n query='authentication and authorization pages',\n limit=10,\n threshold=1.0\n)\nfor block in results:\n print(f\"{block.title} - {block.type}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Semantic global search\nconst results = await client.spaces.semanticGlobal('space-uuid', {\n query: 'authentication and authorization pages',\n limit: 10,\n threshold: 1.0\n});\nfor (const block of results) {\n console.log(`${block.title} - ${block.type}`);\n}\n" } ] } }, "/space/{space_id}/semantic_grep": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve the semantic grep search results for content blocks within a space by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get semantic grep", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "description": "Search query for content blocks", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results to return (1-50, default 10)", "name": "limit", "in": "query" }, { "type": "number", "format": "float64", "description": "Cosine distance threshold (0=identical, 2=opposite)", "name": "threshold", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Semantic grep search\nresults = client.spaces.semantic_grep(\n space_id='space-uuid',\n query='JWT token validation code examples',\n limit=15,\n threshold=0.7\n)\nfor block in results:\n print(f\"{block.title} - distance: {block.distance}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Semantic grep search\nconst results = await client.spaces.semanticGrep('space-uuid', {\n query: 'JWT token validation code examples',\n limit: 15,\n threshold: 0.7\n});\nfor (const block of results) {\n console.log(`${block.title} - distance: ${block.distance}`);\n}\n" } ] } }, "/tool/name": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all tool names within a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tool" ], "summary": "Get tool names", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpclient.ToolReferenceData" } } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get all tool names\ntools = client.tools.list()\nfor tool in tools:\n print(f\"{tool.name}: {tool.sop_count} SOPs\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get all tool names\nconst tools = await client.tools.list();\nfor (const tool of tools) {\n console.log(`${tool.name}: ${tool.sop_count} SOPs`);\n}\n" } ] }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Rename one or more tool names within a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tool" ], "summary": "Rename tool names", "parameters": [ { "description": "Tool rename request", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.RenameToolNameReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.FlagResponse" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Rename tool names\nresult = client.tools.rename([\n {\"old_name\": \"old_tool_name\", \"new_name\": \"new_tool_name\"}\n])\nprint(result.status)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Rename tool names\nconst result = await client.tools.rename([\n { oldName: 'old_tool_name', newName: 'new_tool_name' }\n]);\nconsole.log(result.status);\n" } ] } } }, "definitions": { "fileparser.FileContent": { "type": "object", "properties": { "raw": { "description": "Raw text content", "type": "string" }, "type": { "description": "\"text\", \"json\", \"csv\", \"code\"", "type": "string" } } }, "handler.ConnectToSpaceReq": { "type": "object", "required": [ "space_id" ], "properties": { "space_id": { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000" } } }, "handler.CreateBlockReq": { "type": "object", "required": [ "type" ], "properties": { "parent_id": { "type": "string" }, "props": { "type": "object", "additionalProperties": {} }, "title": { "type": "string" }, "type": { "type": "string", "example": "text" } } }, "handler.CreateSessionReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true }, "space_id": { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-42661417" } } }, "handler.CreateSpaceReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "handler.GetArtifactResp": { "type": "object", "properties": { "artifact": { "$ref": "#/definitions/model.Artifact" }, "content": { "$ref": "#/definitions/fileparser.FileContent" }, "public_url": { "type": "string" } } }, "handler.ListArtifactsResp": { "type": "object", "properties": { "artifacts": { "type": "array", "items": { "$ref": "#/definitions/model.Artifact" } }, "directories": { "type": "array", "items": { "type": "string" } } } }, "handler.MoveBlockReq": { "type": "object", "properties": { "parent_id": { "type": "string" }, "sort": { "type": "integer" } } }, "handler.RenameToolNameReq": { "type": "object", "required": [ "rename" ], "properties": { "rename": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/handler.ToolRenameItem" } } } }, "handler.SendMessageReq": { "type": "object", "required": [ "blob" ], "properties": { "blob": {}, "format": { "type": "string", "enum": [ "acontext", "openai", "anthropic" ], "example": "openai" } } }, "handler.ToolRenameItem": { "type": "object", "required": [ "new_name", "old_name" ], "properties": { "new_name": { "type": "string" }, "old_name": { "type": "string" } } }, "handler.UpdateArtifactResp": { "type": "object", "properties": { "artifact": { "$ref": "#/definitions/model.Artifact" } } }, "handler.UpdateBlockPropertiesReq": { "type": "object", "properties": { "props": { "type": "object", "additionalProperties": {} }, "title": { "type": "string" } } }, "handler.UpdateBlockSortReq": { "type": "object", "properties": { "sort": { "type": "integer" } } }, "handler.UpdateSessionConfigsReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "handler.UpdateSpaceConfigsReq": { "type": "object", "required": [ "configs" ], "properties": { "configs": { "type": "object", "additionalProperties": true } } }, "httpclient.FlagResponse": { "type": "object", "properties": { "errmsg": { "type": "string" }, "status": { "type": "integer" } } }, "httpclient.InsertBlockResponse": { "type": "object", "properties": { "id": { "type": "string" } } }, "httpclient.SearchResultBlockItem": { "type": "object", "properties": { "block_id": { "type": "string" }, "distance": { "type": "number" }, "props": { "type": "object", "additionalProperties": true }, "title": { "type": "string" }, "type": { "type": "string" } } }, "httpclient.SpaceSearchResult": { "type": "object", "properties": { "cited_blocks": { "type": "array", "items": { "$ref": "#/definitions/httpclient.SearchResultBlockItem" } }, "final_answer": { "type": "string" } } }, "httpclient.ToolReferenceData": { "type": "object", "properties": { "name": { "type": "string" }, "sop_count": { "type": "integer" } } }, "model.Artifact": { "type": "object", "properties": { "created_at": { "type": "string" }, "disk_id": { "type": "string" }, "filename": { "type": "string" }, "meta": { "type": "object" }, "path": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Block": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "is_archived": { "type": "boolean" }, "parent_id": { "type": "string" }, "props": { "type": "object" }, "sort": { "type": "integer" }, "space_id": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Disk": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Message": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "meta": { "type": "object" }, "parent_id": { "type": "string" }, "parts": { "type": "array", "items": { "type": "object" } }, "role": { "type": "string" }, "session_id": { "type": "string" }, "session_task_process_status": { "type": "string" }, "task_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Session": { "type": "object", "properties": { "configs": { "type": "object" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "space_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Space": { "type": "object", "properties": { "configs": { "type": "object" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "model.Task": { "type": "object", "properties": { "created_at": { "type": "string" }, "data": { "type": "object" }, "id": { "type": "string" }, "is_planning": { "type": "boolean" }, "order": { "type": "integer" }, "project_id": { "type": "string" }, "session_id": { "type": "string" }, "space_digested": { "type": "boolean" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "serializer.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "error": { "type": "string" }, "msg": { "type": "string" } } }, "service.GetMessagesOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Message" } }, "next_cursor": { "type": "string" }, "public_urls": { "description": "file_name -\u003e url", "type": "object", "additionalProperties": { "$ref": "#/definitions/service.PublicURL" } } } }, "service.GetTasksOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Task" } }, "next_cursor": { "type": "string" } } }, "service.ListDisksOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Disk" } }, "next_cursor": { "type": "string" } } }, "service.ListSessionsOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Session" } }, "next_cursor": { "type": "string" } } }, "service.ListSpacesOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.Space" } }, "next_cursor": { "type": "string" } } }, "service.PublicURL": { "type": "object", "properties": { "expire_at": { "type": "string" }, "url": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Project Bearer token (e.g., \"Bearer sk-ac-xxxx\")", "type": "apiKey", "name": "Authorization", "in": "header" } } }