{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "API for Acontext.", "title": "Acontext API", "contact": {}, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/agent_skills": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all agent skills under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent_skills" ], "summary": "List agent skills", "parameters": [ { "type": "string", "example": "alice@acontext.io", "description": "User identifier to filter skills", "name": "user", "in": "query" }, { "type": "integer", "description": "Limit of agent skills to return, default 20. Max 200.", "name": "limit", "in": "query" }, { "type": "string", "description": "Cursor for pagination", "name": "cursor", "in": "query" }, { "type": "boolean", "description": "Order by created_at descending if true", "name": "time_desc", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.ListAgentSkillsOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List all skills with pagination\nresult = client.skills.list_catalog(limit=50)\nfor skill in result.items:\n print(f\"{skill.name}: {skill.description}\")\n\n# Paginate through all skills\nif result.has_more:\n next_page = client.skills.list_catalog(cursor=result.next_cursor)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@anthropic/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List all skills with pagination\nconst result = await client.skills.list_catalog({ limit: 50 });\nresult.items.forEach(skill =\u003e {\n console.log(`${skill.name}: ${skill.description}`);\n});\n\n// Paginate through all skills\nif (result.has_more) {\n const nextPage = await client.skills.list_catalog({ cursor: result.next_cursor });\n}\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a zip file containing agent skill and extract it to S3. The zip file must contain a SKILL.md file (case-insensitive) with YAML format containing 'name' and 'description' fields. The name and description will be extracted from SKILL.md. Optionally associate with a user identifier.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "agent_skills" ], "summary": "Create agent skill", "parameters": [ { "type": "file", "description": "ZIP file containing agent skill. Must contain SKILL.md (case-insensitive) with YAML format: name and description fields.", "name": "file", "in": "formData", "required": true }, { "type": "string", "example": "alice@acontext.io", "description": "User identifier to associate with the skill", "name": "user", "in": "formData" }, { "type": "string", "description": "Additional metadata (JSON string)", "name": "meta", "in": "formData" } ], "responses": { "201": { "description": "Returns agent skill with name and description extracted from SKILL.md", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.AgentSkills" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\nfrom acontext.uploads import FileUpload\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Upload a skill from a zip file\nwith open('my_skill.zip', 'rb') as f:\n skill = client.skills.create(\n file=FileUpload(filename='my_skill.zip', content=f.read(), content_type='application/zip'),\n user='alice@example.com',\n meta={'version': '1.0'}\n )\nprint(f\"Created skill: {skill.name} (ID: {skill.id})\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@anthropic/acontext';\nimport fs from 'fs';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Upload a skill from a zip file\nconst fileBuffer = fs.readFileSync('my_skill.zip');\nconst skill = await client.skills.create({\n file: ['my_skill.zip', fileBuffer, 'application/zip'],\n user: 'alice@example.com',\n meta: { version: '1.0' }\n});\nconsole.log(`Created skill: ${skill.name} (ID: ${skill.id})`);\n" } ] } }, "/agent_skills/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get agent skill by its UUID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent_skills" ], "summary": "Get agent skill by ID", "parameters": [ { "type": "string", "description": "Agent skill UUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.AgentSkills" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get a skill by ID\nskill = client.skills.get('skill-uuid-here')\nprint(f\"Skill: {skill.name}\")\nprint(f\"Description: {skill.description}\")\nprint(f\"Files: {len(skill.file_index)} file(s)\")\nfor f in skill.file_index:\n print(f\" - {f.path} ({f.mime})\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@anthropic/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get a skill by ID\nconst skill = await client.skills.get('skill-uuid-here');\nconsole.log(`Skill: ${skill.name}`);\nconsole.log(`Description: ${skill.description}`);\nconsole.log(`Files: ${skill.file_index.length} file(s)`);\nskill.file_index.forEach(f =\u003e console.log(` - ${f.path} (${f.mime})`));\n" } ] }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete agent skill and all extracted files from S3", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent_skills" ], "summary": "Delete agent skill", "parameters": [ { "type": "string", "description": "Agent skill UUID", "name": "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 skill by ID\nclient.skills.delete('skill-uuid-here')\nprint('Skill deleted successfully')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@anthropic/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a skill by ID\nawait client.skills.delete('skill-uuid-here');\nconsole.log('Skill deleted successfully');\n" } ] } }, "/agent_skills/{id}/file": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get file content or download URL from agent skill. If the file is text-based (parseable), returns parsed content. Otherwise, returns a presigned download URL.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent_skills" ], "summary": "Get file from agent skill", "parameters": [ { "type": "string", "description": "Agent skill UUID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "File path within the skill (e.g., 'scripts/extract_text.json')", "name": "file_path", "in": "query", "required": true }, { "type": "integer", "description": "URL expiration in seconds for presigned URL (default 900)", "name": "expire", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetFileOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get a file from a skill (text files return content, binary files return URL)\nfile_resp = client.skills.get_file(\n skill_id='skill-uuid-here',\n file_path='scripts/main.py',\n expire=1800 # URL expires in 30 minutes\n)\n\nprint(f\"File: {file_resp.path} ({file_resp.mime})\")\nif file_resp.content:\n print(f\"Content: {file_resp.content.raw}\")\nif file_resp.url:\n print(f\"Download URL: {file_resp.url}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@anthropic/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get a file from a skill (text files return content, binary files return URL)\nconst fileResp = await client.skills.getFile({\n skillId: 'skill-uuid-here',\n filePath: 'scripts/main.py',\n expire: 1800 // URL expires in 30 minutes\n});\n\nconsole.log(`File: ${fileResp.path} (${fileResp.mime})`);\nif (fileResp.content) {\n console.log(`Content: ${fileResp.content.raw}`);\n}\nif (fileResp.url) {\n console.log(`Download URL: ${fileResp.url}`);\n}\n" } ] } }, "/disk": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all disks under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "List disks", "parameters": [ { "type": "string", "example": "alice@acontext.io", "description": "User identifier to filter disks", "name": "user", "in": "query" }, { "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\n# List disks for a specific user\ndisks = client.disks.list(user='alice@acontext.io', limit=10)\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\n// List disks for a specific user\nconst userDisks = await client.disks.list({ user: 'alice@acontext.io', limit: 10 });\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a disk group under a project. Optionally associate with a user identifier.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "disk" ], "summary": "Create disk", "parameters": [ { "description": "CreateDisk payload", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.CreateDiskReq" } } ], "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\n# Create a disk for a specific user\ndisk = client.disks.create(user='alice@acontext.io')\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\n// Create a disk for a specific user\nconst userDisk = await client.disks.create({ user: 'alice@acontext.io' });\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", "example": "/documents/report.pdf", "description": "File path including filename", "name": "file_path", "in": "query", "required": true }, { "type": "boolean", "example": true, "description": "Whether to return public URL, default is true", "name": "with_public_url", "in": "query" }, { "type": "boolean", "example": true, "description": "Whether to return parsed file content, default is true", "name": "with_content", "in": "query" }, { "type": "integer", "example": 3600, "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" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get artifact information\nartifact_info = client.disks.get_artifact(\n disk_id='disk-uuid',\n file_path='/documents/report.pdf',\n with_public_url=True,\n with_content=True,\n expire=3600\n)\nprint(f\"Artifact: {artifact_info.artifact.filename}\")\nif artifact_info.public_url:\n print(f\"Download URL: {artifact_info.public_url}\")\nif artifact_info.content:\n print(f\"Content: {artifact_info.content.text[:100]}...\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get artifact information\nconst artifactInfo = await client.disks.getArtifact('disk-uuid', {\n filePath: '/documents/report.pdf',\n withPublicUrl: true,\n withContent: true,\n expire: 3600\n});\nconsole.log(`Artifact: ${artifactInfo.artifact.filename}`);\nif (artifactInfo.publicUrl) {\n console.log(`Download URL: ${artifactInfo.publicUrl}`);\n}\nif (artifactInfo.content) {\n console.log(`Content: ${artifactInfo.content.text.substring(0, 100)}...`);\n}\n" } ] }, "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": "Update artifact request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateArtifactReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.UpdateArtifactResp" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Update artifact metadata\nartifact = client.disks.update_artifact(\n disk_id='disk-uuid',\n file_path='/documents/report.pdf',\n meta={'category': 'updated', 'reviewed': True, 'version': 2}\n)\nprint(f\"Updated artifact: {artifact.artifact.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Update artifact metadata\nconst artifact = await client.disks.updateArtifact('disk-uuid', {\n filePath: '/documents/report.pdf',\n meta: { category: 'updated', reviewed: true, version: 2 }\n});\nconsole.log(`Updated artifact: ${artifact.artifact.id}`);\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a file and create or update an artifact record under a disk. File size must not exceed the configured maximum upload size limit (default: 16MB).", "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 (size must not exceed configured limit)", "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" } } } ] } }, "413": { "description": "File size exceeds maximum allowed size", "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# Upload a file to disk\nwith open('report.pdf', 'rb') as f:\n artifact = client.disks.upload_artifact(\n disk_id='disk-uuid',\n file=f,\n file_path='/documents/',\n meta={'category': 'reports', 'year': 2024}\n )\nprint(f\"Uploaded artifact: {artifact.id}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\nimport fs from 'fs';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Upload a file to disk\nconst fileBuffer = fs.readFileSync('report.pdf');\nconst artifact = await client.disks.uploadArtifact('disk-uuid', {\n file: fileBuffer,\n filePath: '/documents/',\n meta: { category: 'reports', year: 2024 }\n});\nconsole.log(`Uploaded artifact: ${artifact.id}`);\n" } ] }, "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", "example": "/documents/report.pdf", "description": "File path including filename", "name": "file_path", "in": "query", "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 an artifact\nclient.disks.delete_artifact(\n disk_id='disk-uuid',\n file_path='/documents/report.pdf'\n)\nprint('Artifact deleted successfully')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete an artifact\nawait client.disks.deleteArtifact('disk-uuid', {\n filePath: '/documents/report.pdf'\n});\nconsole.log('Artifact deleted successfully');\n" } ] } }, "/disk/{disk_id}/artifact/download_to_sandbox": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Download an artifact from disk storage to a sandbox environment", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Download artifact to sandbox", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "description": "Download to sandbox request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.DownloadToSandboxReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handler.DownloadToSandboxResp" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Download artifact to sandbox\nresult = client.disks.artifacts.download_to_sandbox(\n disk_id='disk-uuid',\n file_path='/documents/',\n filename='report.pdf',\n sandbox_id='sandbox-uuid',\n sandbox_path='/home/user/'\n)\nprint(f\"Success: {result.success}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Download artifact to sandbox\nconst result = await client.disks.artifacts.downloadToSandbox('disk-uuid', {\n filePath: '/documents/',\n filename: 'report.pdf',\n sandboxId: 'sandbox-uuid',\n sandboxPath: '/home/user/'\n});\nconsole.log(`Success: ${result.success}`);\n" } ] } }, "/disk/{disk_id}/artifact/glob": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search through artifact file paths using glob patterns (*, ?, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Search artifact paths with glob patterns", "parameters": [ { "type": "string", "format": "uuid", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "Glob pattern (e.g., '**/*.py', '*.txt')", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results (default 100, max 1000)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Artifact" } } } } ] } } } } }, "/disk/{disk_id}/artifact/grep": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search through text-based artifact content using regex patterns", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Search artifact content with regex", "parameters": [ { "type": "string", "format": "uuid", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "type": "string", "description": "Regex pattern to search for", "name": "query", "in": "query", "required": true }, { "type": "integer", "description": "Maximum number of results (default 100, max 1000)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Artifact" } } } } ] } } } } }, "/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" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List artifacts in a path\nresult = client.disks.list_artifacts(\n disk_id='disk-uuid',\n path='/documents/'\n)\nprint(f\"Found {len(result.artifacts)} artifacts\")\nfor artifact in result.artifacts:\n print(f\" - {artifact.path}{artifact.filename}\")\nprint(f\"Subdirectories: {', '.join(result.directories)}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List artifacts in a path\nconst result = await client.disks.listArtifacts('disk-uuid', {\n path: '/documents/'\n});\nconsole.log(`Found ${result.artifacts.length} artifacts`);\nfor (const artifact of result.artifacts) {\n console.log(` - ${artifact.path}${artifact.filename}`);\n}\nconsole.log(`Subdirectories: ${result.directories.join(', ')}`);\n" } ] } }, "/disk/{disk_id}/artifact/upload_from_sandbox": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a file from a sandbox environment to disk storage as an artifact", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "artifact" ], "summary": "Upload file from sandbox to disk", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Disk ID", "name": "disk_id", "in": "path", "required": true }, { "description": "Upload from sandbox request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UploadFromSandboxReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Artifact" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Upload file from sandbox to disk\nartifact = client.disks.artifacts.upload_from_sandbox(\n disk_id='disk-uuid',\n sandbox_id='sandbox-uuid',\n sandbox_path='/home/user/',\n sandbox_filename='output.txt',\n file_path='/results/'\n)\nprint(f\"Created: {artifact.path}{artifact.filename}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Upload file from sandbox to disk\nconst artifact = await client.disks.artifacts.uploadFromSandbox('disk-uuid', {\n sandboxId: 'sandbox-uuid',\n sandboxPath: '/home/user/',\n sandboxFilename: 'output.txt',\n filePath: '/results/'\n});\nconsole.log(`Created: ${artifact.path}${artifact.filename}`);\n" } ] } }, "/sandbox": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Create and start a new sandbox for the project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "sandbox" ], "summary": "Create a new sandbox", "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.SandboxRuntimeInfo" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Create a new sandbox\nsandbox = client.sandboxes.create()\nprint(f\"Sandbox ID: {sandbox.sandbox_id}\")\nprint(f\"Status: {sandbox.sandbox_status}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Create a new sandbox\nconst sandbox = await client.sandboxes.create();\nconsole.log(`Sandbox ID: ${sandbox.sandbox_id}`);\nconsole.log(`Status: ${sandbox.sandbox_status}`);\n" } ] } }, "/sandbox/{sandbox_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Kill a running sandbox", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "sandbox" ], "summary": "Kill a sandbox", "parameters": [ { "type": "string", "description": "Sandbox ID", "name": "sandbox_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# Kill a sandbox\nresult = client.sandboxes.kill(sandbox_id='sandbox-uuid')\nprint(f\"Status: {result.status}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Kill a sandbox\nconst result = await client.sandboxes.kill('sandbox-uuid');\nconsole.log(`Status: ${result.status}`);\n" } ] } }, "/sandbox/{sandbox_id}/exec": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Execute a shell command in the specified sandbox", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "sandbox" ], "summary": "Execute command in sandbox", "parameters": [ { "type": "string", "description": "Sandbox ID", "name": "sandbox_id", "in": "path", "required": true }, { "description": "Command to execute", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ExecCommandReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpclient.SandboxCommandOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Execute a command in the sandbox\nresult = client.sandboxes.exec_command(\n sandbox_id='sandbox-uuid',\n command='ls -la'\n)\nprint(f\"stdout: {result.stdout}\")\nprint(f\"stderr: {result.stderr}\")\nprint(f\"exit_code: {result.exit_code}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Execute a command in the sandbox\nconst result = await client.sandboxes.execCommand({\n sandboxId: 'sandbox-uuid',\n command: 'ls -la'\n});\nconsole.log(`stdout: ${result.stdout}`);\nconsole.log(`stderr: ${result.stderr}`);\nconsole.log(`exit_code: ${result.exit_code}`);\n" } ] } }, "/session": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all sessions under a project, optionally filtered by space_id or user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get sessions", "parameters": [ { "type": "string", "example": "alice@acontext.io", "description": "User identifier to filter sessions", "name": "user", "in": "query" }, { "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", "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.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\n# List sessions for a specific user\nsessions = client.sessions.list(user='alice@acontext.io', limit=20)\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\n// List sessions for a specific user\nconst userSessions = await client.sessions.list({ user: 'alice@acontext.io', limit: 20 });\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new session under a space. Optionally associate with a user identifier.", "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)\nprint(f\"Created session: {session.id}\")\n\n# Create a session for a specific user\nsession = client.sessions.create(user='alice@acontext.io', 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// Create a session\nconst session = await client.sessions.create({\n spaceId: 'space-uuid'\n});\nconsole.log(`Created session: ${session.id}`);\n\n// Create a session for a specific user\nconst userSession = await client.sessions.create({ user: 'alice@acontext.io', spaceId: 'space-uuid' });\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)\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" } ] } }, "/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}/get_learning_status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get learning status for a session. Returns the count of space digested tasks and not space digested tasks. If the session is not connected to a space, returns 0 and 0.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get learning status", "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.LearningStatusResponse" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get learning status\nresult = client.sessions.get_learning_status(session_id='session-uuid')\nprint(f\"Space digested: {result.space_digested_count}, Not digested: {result.not_space_digested_count}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get learning status\nconst result = await client.sessions.getLearningStatus('session-uuid');\nconsole.log(`Space digested: ${result.space_digested_count}, Not digested: ${result.not_space_digested_count}`);\n" } ] } }, "/session/{session_id}/messages": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get messages from session. Default format is openai. Can convert to acontext (original), anthropic, or gemini 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. Max 200. If limit is 0 or not provided, all messages will be returned. \n\nWARNING!\n Use `limit` only for read-only/display purposes (pagination, viewing). Do NOT use `limit` to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the `token_limit` edit strategy in `edit_strategies` parameter to safely manage message context size.", "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", "example": "true", "description": "Whether to return asset public url, default is true", "name": "with_asset_public_url", "in": "query" }, { "enum": [ "acontext", "openai", "anthropic", "gemini" ], "type": "string", "description": "Format to convert messages to: acontext (original), openai (default), anthropic, gemini.", "name": "format", "in": "query" }, { "type": "string", "example": "false", "description": "Order by created_at descending if true, ascending if false (default false)", "name": "time_desc", "in": "query" }, { "type": "string", "example": "[{\"type\":\"remove_tool_result\",\"params\":{\"keep_recent_n_tool_results\":3}}]", "description": "JSON array of edit strategies to apply before format conversion", "name": "edit_strategies", "in": "query" }, { "type": "string", "example": "", "description": "Message ID to pin editing strategies at. When provided, strategies are only applied to messages up to and including this message ID, keeping subsequent messages unchanged. This helps maintain prompt cache stability by preserving a stable prefix. The response will include edit_at_message_id indicating where strategies were applied.", "name": "pin_editing_strategies_at_message", "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": "Store message to session", "parameters": [ { "type": "string", "format": "uuid", "description": "Session ID", "name": "session_id", "in": "path", "required": true }, { "description": "StoreMessage payload (Content-Type: application/json)", "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.StoreMessageReq" } }, { "type": "string", "description": "StoreMessage 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# Store a message in Acontext format\nmessage = build_acontext_message(role='user', parts=['Hello!'])\nclient.sessions.store_message(\n session_id='session-uuid',\n blob=message,\n format='acontext'\n)\n\n# Store a message in OpenAI format\nopenai_message = {'role': 'user', 'content': 'Hello from OpenAI format!'}\nclient.sessions.store_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// Store a message in Acontext format\nawait client.sessions.storeMessage(\n 'session-uuid',\n {\n role: 'user',\n parts: [MessagePart.textPart('Hello!')]\n },\n { format: 'acontext' }\n);\n\n// Store a message in OpenAI format\nawait client.sessions.storeMessage(\n 'session-uuid',\n {\n role: 'user',\n content: 'Hello from OpenAI format!'\n },\n { format: 'openai' }\n);\n" } ] } }, "/session/{session_id}/observing_status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Returns the count of observed, in_process, and pending messages", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get message observing status for a 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/model.MessageObservingStatus" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get message observing status\nresult = client.sessions.messages_observing_status(session_id='session-uuid')\nprint(f\"Observed: {result.observed}, In Process: {result.in_process}, Pending: {result.pending}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get message observing status\nconst result = await client.sessions.messagesObservingStatus('session-uuid');\nconsole.log(`Observed: ${result.observed}, In Process: ${result.in_process}, Pending: ${result.pending}`);\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" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get tasks from a session\ntasks = client.sessions.get_tasks(\n session_id='session-uuid',\n limit=20,\n time_desc=False\n)\nprint(f\"Found {len(tasks.items)} tasks\")\nfor task in tasks.items:\n print(f\"Task {task.id}: {task.status}\")\n\n# If there are more tasks, use the cursor for pagination\nif tasks.has_more:\n next_tasks = client.sessions.get_tasks(\n session_id='session-uuid',\n limit=20,\n cursor=tasks.next_cursor\n )\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get tasks from a session\nconst tasks = await client.sessions.getTasks('session-uuid', {\n limit: 20,\n timeDesc: false\n});\nconsole.log(`Found ${tasks.items.length} tasks`);\nfor (const task of tasks.items) {\n console.log(`Task ${task.id}: ${task.status}`);\n}\n\n// If there are more tasks, use the cursor for pagination\nif (tasks.hasMore) {\n const nextTasks = await client.sessions.getTasks('session-uuid', {\n limit: 20,\n cursor: tasks.nextCursor\n });\n}\n" } ] } }, "/session/{session_id}/token_counts": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get total token counts for all text and tool-call parts in a session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "session" ], "summary": "Get token counts for 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/handler.TokenCountsResp" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get token counts\nresult = client.sessions.get_token_counts(session_id='session-uuid')\nprint(f\"Total tokens: {result.total_tokens}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get token counts\nconst result = await client.sessions.getTokenCounts('session-uuid');\nconsole.log(`Total tokens: ${result.total_tokens}`);\n" } ] } }, "/space": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all spaces under a project", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get spaces", "parameters": [ { "type": "string", "example": "alice@acontext.io", "description": "User identifier to filter spaces", "name": "user", "in": "query" }, { "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", "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.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\n# List spaces for a specific user\nspaces = client.spaces.list(user='alice@acontext.io', limit=20)\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\n// List spaces for a specific user\nconst userSpaces = await client.spaces.list({ user: 'alice@acontext.io', limit: 20 });\n" } ] }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new space under a project. Optionally associate with a user identifier.", "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()\nprint(f\"Created space: {space.id}\")\n\n# Create a space for a specific user\nspace = client.spaces.create(user='alice@acontext.io')\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();\nconsole.log(`Created space: ${space.id}`);\n\n// Create a space for a specific user\nconst userSpace = await client.spaces.create({ user: 'alice@acontext.io' });\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, sop). 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", "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 types: page, folder, sop). For page and folder types, parent_id is optional. For sop type, 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 folder\nfolder = client.blocks.create(\n space_id='space-uuid',\n block_type='folder',\n title='My Folder'\n)\n\n# Create a page under the folder\npage = client.blocks.create(\n space_id='space-uuid',\n parent_id=folder['id'],\n block_type='page',\n title='My Page',\n props={\"description\": \"Page 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 folder\nconst folder = await client.blocks.create('space-uuid', {\n blockType: 'folder',\n title: 'My Folder'\n});\n\n// Create a page under the folder\nconst page = await client.blocks.create('space-uuid', {\n parentId: folder.id,\n blockType: 'page',\n title: 'My Page',\n props: { description: 'Page content here' }\n});\n" } ] } }, "/space/{space_id}/block/{block_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a block by its ID (works for block types: page, folder, sop)", "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 block types: page, folder, sop. 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 block types: page, folder, sop)", "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 block types: page, folder, sop)", "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 block types: page, folder, sop)", "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)\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" } ] } }, "/space/{space_id}/experience_confirmations": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all experience confirmations in a space with cursor-based pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Get experience confirmations", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "integer", "description": "Limit of confirmations 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.ListExperienceConfirmationsOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get unconfirmed experiences\nexperiences = client.spaces.get_unconfirmed_experiences(\n space_id='space-uuid',\n limit=20,\n time_desc=True\n)\nfor experience in experiences.items:\n print(f\"{experience.id}: {experience.experience_data}\")\n\n# If there are more, use the cursor for pagination\nif experiences.has_more:\n next_experiences = client.spaces.get_unconfirmed_experiences(\n space_id='space-uuid',\n limit=20,\n cursor=experiences.next_cursor\n )\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get unconfirmed experiences\nconst experiences = await client.spaces.getUnconfirmedExperiences('space-uuid', {\n limit: 20,\n timeDesc: true\n});\nfor (const experience of experiences.items) {\n console.log(`${experience.id}: ${JSON.stringify(experience.experience_data)}`);\n}\n\n// If there are more, use the cursor for pagination\nif (experiences.hasMore) {\n const nextExperiences = await client.spaces.getUnconfirmedExperiences('space-uuid', {\n limit: 20,\n cursor: experiences.nextCursor\n });\n}\n" } ] } }, "/space/{space_id}/experience_confirmations/{experience_id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Confirm an experience confirmation. If save is false, delete the row. If save is true, get the data first (TODO: process data), then delete the row.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "space" ], "summary": "Confirm experience", "parameters": [ { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Space ID", "name": "space_id", "in": "path", "required": true }, { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-426614174000", "description": "Experience Confirmation ID", "name": "experience_id", "in": "path", "required": true }, { "description": "Confirmation request with save flag", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ConfirmExperienceReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ExperienceConfirmation" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Confirm experience and save data\nconfirmation = client.spaces.confirm_experience(\n space_id='space-uuid',\n experience_id='experience-uuid',\n save=True\n)\nprint(f\"Saved confirmation: {confirmation.experience_data}\")\n\n# Confirm experience without saving (just delete)\nclient.spaces.confirm_experience(\n space_id='space-uuid',\n experience_id='experience-uuid',\n save=False\n)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Confirm experience and save data\nconst confirmation = await client.spaces.confirmExperience('space-uuid', 'experience-uuid', {\n save: true\n});\nconsole.log(`Saved confirmation: ${JSON.stringify(confirmation.experience_data)}`);\n\n// Confirm experience without saving (just delete)\nawait client.spaces.confirmExperience('space-uuid', 'experience-uuid', {\n save: false\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" } ] } }, "/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" } ] } }, "/user/ls": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all users under a project. If limit is not provided or 0, all users will be returned.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List users", "parameters": [ { "type": "integer", "description": "Limit of users to return. Max 200. If limit is 0 or not provided, all users will be returned.", "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.ListUsersOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# List all users\nusers = client.users.list()\nfor user in users.items:\n print(f\"{user.identifier}: {user.id}\")\n\n# List users with pagination\nusers = client.users.list(limit=20, time_desc=True)\nif users.has_more:\n next_users = client.users.list(limit=20, cursor=users.next_cursor)\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// List all users\nconst users = await client.users.list();\nfor (const user of users.items) {\n console.log(`${user.identifier}: ${user.id}`);\n}\n\n// List users with pagination\nconst paginatedUsers = await client.users.list({ limit: 20, timeDesc: true });\nif (paginatedUsers.hasMore) {\n const nextUsers = await client.users.list({ limit: 20, cursor: paginatedUsers.nextCursor });\n}\n" } ] } }, "/user/{identifier}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a user by identifier and cascade delete all associated resources (Space, Session, Disk, Skill)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete user", "parameters": [ { "type": "string", "description": "User identifier string", "name": "identifier", "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 user and all associated resources\nclient.users.delete('alice@acontext.io')\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Delete a user and all associated resources\nawait client.users.delete('alice@acontext.io');\n" } ] } }, "/user/{identifier}/resources": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get the resource counts (Spaces, Sessions, Disks, Skills) associated with a user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user resources", "parameters": [ { "type": "string", "description": "User identifier string", "name": "identifier", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/serializer.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/service.GetUserResourcesOutput" } } } ] } } }, "x-code-samples": [ { "label": "Python", "lang": "python", "source": "from acontext import AcontextClient\n\nclient = AcontextClient(api_key='sk_project_token')\n\n# Get user resource counts\nresources = client.users.get_resources('alice@acontext.io')\nprint(f\"Spaces: {resources.spaces_count}\")\nprint(f\"Sessions: {resources.sessions_count}\")\nprint(f\"Disks: {resources.disks_count}\")\nprint(f\"Skills: {resources.skills_count}\")\n" }, { "label": "JavaScript", "lang": "javascript", "source": "import { AcontextClient } from '@acontext/acontext';\n\nconst client = new AcontextClient({ apiKey: 'sk_project_token' });\n\n// Get user resource counts\nconst resources = await client.users.getResources('alice@acontext.io');\nconsole.log(`Spaces: ${resources.spaces_count}`);\nconsole.log(`Sessions: ${resources.sessions_count}`);\nconsole.log(`Disks: ${resources.disks_count}`);\nconsole.log(`Skills: ${resources.skills_count}`);\n" } ] } } }, "definitions": { "fileparser.FileContent": { "type": "object", "properties": { "raw": { "description": "Raw text content", "type": "string" }, "type": { "description": "\"text\", \"json\", \"csv\", \"code\"", "type": "string" } } }, "handler.ConfirmExperienceReq": { "type": "object", "required": [ "save" ], "properties": { "save": { "type": "boolean" } } }, "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": "page" } } }, "handler.CreateDiskReq": { "type": "object", "properties": { "user": { "type": "string", "example": "alice@acontext.io" } } }, "handler.CreateSessionReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true }, "disable_task_tracking": { "type": "boolean", "example": false }, "space_id": { "type": "string", "format": "uuid", "example": "123e4567-e89b-12d3-a456-42661417" }, "user": { "type": "string", "example": "alice@acontext.io" } } }, "handler.CreateSpaceReq": { "type": "object", "properties": { "configs": { "type": "object", "additionalProperties": true }, "user": { "type": "string", "example": "alice@acontext.io" } } }, "handler.DownloadToSandboxReq": { "type": "object", "required": [ "file_path", "filename", "sandbox_id", "sandbox_path" ], "properties": { "file_path": { "description": "File path (directory) of the artifact", "type": "string" }, "filename": { "description": "Filename of the artifact", "type": "string" }, "sandbox_id": { "description": "Target sandbox ID", "type": "string" }, "sandbox_path": { "description": "Destination directory in the sandbox", "type": "string" } } }, "handler.DownloadToSandboxResp": { "type": "object", "properties": { "success": { "type": "boolean" } } }, "handler.ExecCommandReq": { "type": "object", "required": [ "command" ], "properties": { "command": { "type": "string" } } }, "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.StoreMessageReq": { "type": "object", "required": [ "blob" ], "properties": { "blob": {}, "format": { "type": "string", "enum": [ "acontext", "openai", "anthropic", "gemini" ], "example": "openai" } } }, "handler.TokenCountsResp": { "type": "object", "properties": { "total_tokens": { "type": "integer" } } }, "handler.ToolRenameItem": { "type": "object", "required": [ "new_name", "old_name" ], "properties": { "new_name": { "type": "string" }, "old_name": { "type": "string" } } }, "handler.UpdateArtifactReq": { "type": "object", "required": [ "file_path", "meta" ], "properties": { "file_path": { "description": "File path including filename", "type": "string" }, "meta": { "description": "Custom metadata as JSON string", "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 } } }, "handler.UploadFromSandboxReq": { "type": "object", "required": [ "file_path", "sandbox_filename", "sandbox_id", "sandbox_path" ], "properties": { "file_path": { "description": "Destination directory path on the disk", "type": "string" }, "sandbox_filename": { "description": "Filename in the sandbox", "type": "string" }, "sandbox_id": { "description": "Source sandbox ID", "type": "string" }, "sandbox_path": { "description": "Source directory in the sandbox", "type": "string" } } }, "httpclient.FlagResponse": { "type": "object", "properties": { "errmsg": { "type": "string" }, "status": { "type": "integer" } } }, "httpclient.InsertBlockResponse": { "type": "object", "properties": { "id": { "type": "string" } } }, "httpclient.LearningStatusResponse": { "type": "object", "properties": { "not_space_digested_count": { "type": "integer" }, "space_digested_count": { "type": "integer" } } }, "httpclient.SandboxCommandOutput": { "type": "object", "properties": { "exit_code": { "type": "integer" }, "stderr": { "type": "string" }, "stdout": { "type": "string" } } }, "httpclient.SandboxRuntimeInfo": { "type": "object", "properties": { "sandbox_created_at": { "type": "string" }, "sandbox_expires_at": { "type": "string" }, "sandbox_id": { "type": "string" }, "sandbox_status": { "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" } } } }, "httpclient.ToolReferenceData": { "type": "object", "properties": { "name": { "type": "string" }, "sop_count": { "type": "integer" } } }, "model.AgentSkills": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "file_index": { "description": "FileIndex contains file information (path and MIME type) from the skillName root directory\nExample: [{\"path\": \"SKILL.md\", \"mime\": \"text/markdown\"}, {\"path\": \"scripts/extract_text.json\", \"mime\": \"application/json\"}]\nThese paths are relative to baseS3Key (which includes skillName)\nFull S3 key = baseS3Key + \"/\" + fileIndex[i].Path", "type": "array", "items": { "type": "object" } }, "id": { "type": "string" }, "meta": { "type": "object" }, "name": { "description": "Name is not unique - multiple skills can have the same name", "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "string" } } }, "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" }, "user_id": { "type": "string" } } }, "model.ExperienceConfirmation": { "type": "object", "properties": { "created_at": { "type": "string" }, "experience_data": { "type": "object" }, "id": { "type": "string" }, "space_id": { "type": "string" }, "task_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.MessageObservingStatus": { "type": "object", "properties": { "in_process": { "type": "integer" }, "observed": { "type": "integer" }, "pending": { "type": "integer" }, "updated_at": { "type": "string" } } }, "model.Session": { "type": "object", "properties": { "configs": { "type": "object" }, "created_at": { "type": "string" }, "disable_task_tracking": { "type": "boolean" }, "id": { "type": "string" }, "project_id": { "type": "string" }, "space_id": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "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" }, "user_id": { "type": "string" } } }, "model.Task": { "type": "object", "properties": { "created_at": { "type": "string" }, "data": { "$ref": "#/definitions/model.TaskData" }, "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" } } }, "model.TaskData": { "type": "object", "properties": { "progresses": { "type": "array", "items": { "type": "string" } }, "sop_thinking": { "type": "string" }, "task_description": { "type": "string" }, "user_preferences": { "type": "array", "items": { "type": "string" } } } }, "model.User": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "string" }, "identifier": { "type": "string" }, "project_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "repo.UserResourceCounts": { "type": "object", "properties": { "disks_count": { "type": "integer" }, "sessions_count": { "type": "integer" }, "skills_count": { "type": "integer" }, "spaces_count": { "type": "integer" } } }, "serializer.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "error": { "type": "string" }, "msg": { "type": "string" } } }, "service.AgentSkillsListItem": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "meta": { "type": "object", "additionalProperties": true }, "name": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "string" } } }, "service.GetFileOutput": { "type": "object", "properties": { "content": { "description": "Present if file is text-based and parseable", "allOf": [ { "$ref": "#/definitions/fileparser.FileContent" } ] }, "mime": { "type": "string" }, "path": { "type": "string" }, "url": { "description": "Present if file is not text-based or not parseable", "type": "string" } } }, "service.GetMessagesOutput": { "type": "object", "properties": { "edit_at_message_id": { "type": "string" }, "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.GetUserResourcesOutput": { "type": "object", "properties": { "counts": { "$ref": "#/definitions/repo.UserResourceCounts" } } }, "service.ListAgentSkillsOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/service.AgentSkillsListItem" } }, "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.ListExperienceConfirmationsOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.ExperienceConfirmation" } }, "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.ListUsersOutput": { "type": "object", "properties": { "has_more": { "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.User" } }, "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" } } }