{
    "swagger": "2.0",
    "info": {
        "title": "Memoh API",
        "contact": {},
        "version": "1.0.0"
    },
    "paths": {
        "/auth/login": {
            "post": {
                "description": "Validate user credentials and issue a JWT",
                "tags": [
                    "auth"
                ],
                "summary": "Login",
                "parameters": [
                    {
                        "description": "Login request",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.LoginRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.LoginResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots": {
            "get": {
                "description": "List bots accessible to current user (admin can specify owner_id)",
                "tags": [
                    "bots"
                ],
                "summary": "List bots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Owner user ID (admin only)",
                        "name": "owner_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.ListBotsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a bot user owned by current user (or admin-specified owner)",
                "tags": [
                    "bots"
                ],
                "summary": "Create bot user",
                "parameters": [
                    {
                        "description": "Bot payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/bots.CreateBotRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/bots.Bot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/container": {
            "get": {
                "tags": [
                    "containerd"
                ],
                "summary": "Get container info for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.GetContainerResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "containerd"
                ],
                "summary": "Create and start MCP container for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Create container payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateContainerRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateContainerResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "containerd"
                ],
                "summary": "Delete MCP container for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/container/skills": {
            "get": {
                "tags": [
                    "containerd"
                ],
                "summary": "List skills from data directory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SkillsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "containerd"
                ],
                "summary": "Upload skills into data directory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Skills payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.SkillsUpsertRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.skillsOpResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "containerd"
                ],
                "summary": "Delete skills from data directory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Delete skills payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.SkillsDeleteRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.skillsOpResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/container/snapshots": {
            "get": {
                "tags": [
                    "containerd"
                ],
                "summary": "List snapshots",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Snapshotter name",
                        "name": "snapshotter",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ListSnapshotsResponse"
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "containerd"
                ],
                "summary": "Create container snapshot for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Create snapshot payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateSnapshotRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateSnapshotResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/container/start": {
            "post": {
                "tags": [
                    "containerd"
                ],
                "summary": "Start container task for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/container/stop": {
            "post": {
                "tags": [
                    "containerd"
                ],
                "summary": "Stop container task for bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp": {
            "get": {
                "description": "List MCP connections for a bot",
                "tags": [
                    "mcp"
                ],
                "summary": "List MCP connections",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/mcp.ListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a MCP connection for a bot",
                "tags": [
                    "mcp"
                ],
                "summary": "Create MCP connection",
                "parameters": [
                    {
                        "description": "MCP payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/mcp.UpsertRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp-ops/batch-delete": {
            "post": {
                "description": "Delete multiple MCP connections by IDs.",
                "tags": [
                    "mcp"
                ],
                "summary": "Batch delete MCP connections",
                "parameters": [
                    {
                        "description": "IDs to delete",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.BatchDeleteRequest"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp-stdio": {
            "post": {
                "description": "Start a stdio MCP process in the bot container and expose it as MCP HTTP endpoint.",
                "tags": [
                    "containerd"
                ],
                "summary": "Create MCP stdio proxy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Stdio MCP payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.MCPStdioRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MCPStdioResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp-stdio/{connection_id}": {
            "post": {
                "description": "Proxies MCP JSON-RPC requests to a stdio MCP process in the container.",
                "tags": [
                    "containerd"
                ],
                "summary": "MCP stdio proxy (JSON-RPC)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Connection ID",
                        "name": "connection_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "JSON-RPC request",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON-RPC response: {jsonrpc,id,result|error}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp/export": {
            "get": {
                "description": "Export all MCP connections for a bot in standard mcpServers format.",
                "tags": [
                    "mcp"
                ],
                "summary": "Export MCP connections",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/mcp.ExportResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp/import": {
            "put": {
                "description": "Batch import MCP connections from standard mcpServers format. Existing connections (matched by name) get config updated with is_active preserved. New connections are created as active.",
                "tags": [
                    "mcp"
                ],
                "summary": "Import MCP connections",
                "parameters": [
                    {
                        "description": "mcpServers dict",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/mcp.ImportRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/mcp.ListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/mcp/{id}": {
            "get": {
                "description": "Get a MCP connection by ID",
                "tags": [
                    "mcp"
                ],
                "summary": "Get MCP connection",
                "parameters": [
                    {
                        "type": "string",
                        "description": "MCP ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a MCP connection by ID",
                "tags": [
                    "mcp"
                ],
                "summary": "Update MCP connection",
                "parameters": [
                    {
                        "type": "string",
                        "description": "MCP ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "MCP payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/mcp.UpsertRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a MCP connection by ID",
                "tags": [
                    "mcp"
                ],
                "summary": "Delete MCP connection",
                "parameters": [
                    {
                        "type": "string",
                        "description": "MCP ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory": {
            "get": {
                "description": "List all memories in the bot-shared namespace",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Get all memories",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.SearchResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Add memory into the bot-shared namespace",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Add memory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Memory add payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.memoryAddPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.SearchResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete specific memories by IDs, or delete all memories if no IDs are provided",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Delete memories",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Optional: specify memory_ids to delete; if omitted, deletes all",
                        "name": "payload",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/handlers.memoryDeletePayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.DeleteResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory/compact": {
            "post": {
                "description": "Consolidate memories by merging similar/redundant entries using LLM.\n\n**ratio** (required, range (0,1]):\n- 0.8 = light compression, mostly dedup, keep ~80% of entries\n- 0.5 = moderate compression, merge similar facts, keep ~50%\n- 0.3 = aggressive compression, heavily consolidate, keep ~30%\n\n**decay_days** (optional): enable time decay — memories older than N days are treated as low priority and more likely to be merged/dropped.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Compact memories",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "ratio (0,1] required; decay_days optional",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.memoryCompactPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.CompactResult"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory/rebuild": {
            "post": {
                "description": "Read memory files from the container filesystem (source of truth) and restore missing entries to Qdrant",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Rebuild memories from filesystem",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.RebuildResult"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory/search": {
            "post": {
                "description": "Search memory in the bot-shared namespace",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Search memory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Memory search payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.memorySearchPayload"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.SearchResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory/usage": {
            "get": {
                "description": "Query the estimated storage usage of current memories",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Get memory usage",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.UsageResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/memory/{id}": {
            "delete": {
                "description": "Delete a single memory by its ID",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "memory"
                ],
                "summary": "Delete a single memory",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Memory ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/memory.DeleteResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/schedule": {
            "get": {
                "description": "List schedules for current user",
                "tags": [
                    "schedule"
                ],
                "summary": "List schedules",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/schedule.ListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a schedule for current user",
                "tags": [
                    "schedule"
                ],
                "summary": "Create schedule",
                "parameters": [
                    {
                        "description": "Schedule payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schedule.CreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/schedule.Schedule"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/schedule/{id}": {
            "get": {
                "description": "Get a schedule by ID",
                "tags": [
                    "schedule"
                ],
                "summary": "Get schedule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Schedule ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/schedule.Schedule"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a schedule by ID",
                "tags": [
                    "schedule"
                ],
                "summary": "Update schedule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Schedule ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Schedule payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schedule.UpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/schedule.Schedule"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a schedule by ID",
                "tags": [
                    "schedule"
                ],
                "summary": "Delete schedule",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Schedule ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/settings": {
            "get": {
                "description": "Get agent settings for current user",
                "tags": [
                    "settings"
                ],
                "summary": "Get user settings",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/settings.Settings"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update or create agent settings for current user",
                "tags": [
                    "settings"
                ],
                "summary": "Update user settings",
                "parameters": [
                    {
                        "description": "Settings payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/settings.UpsertRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/settings.Settings"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Update or create agent settings for current user",
                "tags": [
                    "settings"
                ],
                "summary": "Update user settings",
                "parameters": [
                    {
                        "description": "Settings payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/settings.UpsertRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/settings.Settings"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Remove agent settings for current user",
                "tags": [
                    "settings"
                ],
                "summary": "Delete user settings",
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/subagents": {
            "get": {
                "description": "List subagents for current user",
                "tags": [
                    "subagent"
                ],
                "summary": "List subagents",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.ListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a subagent for current user",
                "tags": [
                    "subagent"
                ],
                "summary": "Create subagent",
                "parameters": [
                    {
                        "description": "Subagent payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/subagent.CreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/subagent.Subagent"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/subagents/{id}": {
            "get": {
                "description": "Get a subagent by ID",
                "tags": [
                    "subagent"
                ],
                "summary": "Get subagent",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.Subagent"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a subagent by ID",
                "tags": [
                    "subagent"
                ],
                "summary": "Update subagent",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Subagent payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/subagent.UpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.Subagent"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a subagent by ID",
                "tags": [
                    "subagent"
                ],
                "summary": "Delete subagent",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/subagents/{id}/context": {
            "get": {
                "description": "Get a subagent's message context",
                "tags": [
                    "subagent"
                ],
                "summary": "Get subagent context",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.ContextResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a subagent's message context",
                "tags": [
                    "subagent"
                ],
                "summary": "Update subagent context",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Context payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/subagent.UpdateContextRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.ContextResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/subagents/{id}/skills": {
            "get": {
                "description": "Get a subagent's skills",
                "tags": [
                    "subagent"
                ],
                "summary": "Get subagent skills",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.SkillsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Replace a subagent's skills",
                "tags": [
                    "subagent"
                ],
                "summary": "Update subagent skills",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Skills payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/subagent.UpdateSkillsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.SkillsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Add skills to a subagent",
                "tags": [
                    "subagent"
                ],
                "summary": "Add subagent skills",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Subagent ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Skills payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/subagent.AddSkillsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/subagent.SkillsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{bot_id}/tools": {
            "post": {
                "description": "MCP endpoint for tool discovery and invocation.",
                "tags": [
                    "containerd"
                ],
                "summary": "Unified MCP tools gateway",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "bot_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "JSON-RPC request",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON-RPC response: {jsonrpc,id,result|error}",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}": {
            "get": {
                "description": "Get a bot by ID (owner/admin only)",
                "tags": [
                    "bots"
                ],
                "summary": "Get bot details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.Bot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update bot profile (owner/admin only)",
                "tags": [
                    "bots"
                ],
                "summary": "Update bot details",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Bot update payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/bots.UpdateBotRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.Bot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a bot user (owner/admin only)",
                "tags": [
                    "bots"
                ],
                "summary": "Delete bot",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/channel/{platform}": {
            "get": {
                "description": "Get bot channel configuration",
                "tags": [
                    "bots"
                ],
                "summary": "Get bot channel config",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/channel.ChannelConfig"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update bot channel configuration",
                "tags": [
                    "bots"
                ],
                "summary": "Update bot channel config",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Channel config payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/channel.UpsertConfigRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/channel.ChannelConfig"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/channel/{platform}/send": {
            "post": {
                "description": "Send a message using bot channel configuration",
                "tags": [
                    "bots"
                ],
                "summary": "Send message via bot channel",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Send payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/channel.SendRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/channel/{platform}/send_chat": {
            "post": {
                "description": "Send a message using a session-scoped token (reply only)",
                "tags": [
                    "bots"
                ],
                "summary": "Send message via bot channel session token",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Send payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/channel.SendRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/checks": {
            "get": {
                "description": "Evaluate bot attached resource checks in runtime",
                "tags": [
                    "bots"
                ],
                "summary": "List bot runtime checks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.ListChecksResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/checks/keys": {
            "get": {
                "description": "Returns all check keys available for a bot (builtin + MCP connections)",
                "tags": [
                    "bots"
                ],
                "summary": "List available check keys",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.ListCheckKeysResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/checks/run/{key}": {
            "get": {
                "description": "Evaluate one check key for a bot",
                "tags": [
                    "bots"
                ],
                "summary": "Run a single bot check",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Check key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.BotCheck"
                        }
                    }
                }
            }
        },
        "/bots/{id}/members": {
            "get": {
                "description": "List members for a bot",
                "tags": [
                    "bots"
                ],
                "summary": "List bot members",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.ListMembersResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Add or update bot member role",
                "tags": [
                    "bots"
                ],
                "summary": "Upsert bot member",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Member payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/bots.UpsertMemberRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.BotMember"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/members/{user_id}": {
            "delete": {
                "description": "Remove a member from a bot",
                "tags": [
                    "bots"
                ],
                "summary": "Delete bot member",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "user_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/bots/{id}/owner": {
            "put": {
                "description": "Transfer bot ownership to another human user",
                "tags": [
                    "bots"
                ],
                "summary": "Transfer bot owner (admin only)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Bot ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Transfer payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/bots.TransferBotRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/bots.Bot"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/channels": {
            "get": {
                "description": "List channel meta information including capabilities and schemas",
                "tags": [
                    "channel"
                ],
                "summary": "List channel capabilities and schemas",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.ChannelMeta"
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/channels/{platform}": {
            "get": {
                "description": "Get channel meta information including capabilities and schemas",
                "tags": [
                    "channel"
                ],
                "summary": "Get channel capabilities and schemas",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ChannelMeta"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/embeddings": {
            "post": {
                "description": "Create text or multimodal embeddings",
                "tags": [
                    "embeddings"
                ],
                "summary": "Create embeddings",
                "parameters": [
                    {
                        "description": "Embeddings request",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.EmbeddingsRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.EmbeddingsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "501": {
                        "description": "Not Implemented",
                        "schema": {
                            "$ref": "#/definitions/handlers.EmbeddingsResponse"
                        }
                    }
                }
            }
        },
        "/models": {
            "get": {
                "description": "Get a list of all configured models, optionally filtered by type or client type",
                "tags": [
                    "models"
                ],
                "summary": "List all models",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model type (chat, embedding)",
                        "name": "type",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Client type (openai, openai-compat, anthropic, google, azure, bedrock, mistral, xai, ollama, dashscope)",
                        "name": "client_type",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.GetResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new model configuration",
                "tags": [
                    "models"
                ],
                "summary": "Create a new model",
                "parameters": [
                    {
                        "description": "Model configuration",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.AddRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/models.AddResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/models/count": {
            "get": {
                "description": "Get the total count of models, optionally filtered by type",
                "tags": [
                    "models"
                ],
                "summary": "Get model count",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model type (chat, embedding)",
                        "name": "type",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.CountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/models/model/{modelId}": {
            "get": {
                "description": "Get a model configuration by its model_id field (e.g., gpt-4)",
                "tags": [
                    "models"
                ],
                "summary": "Get model by model ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model ID (e.g., gpt-4)",
                        "name": "modelId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a model configuration by its model_id field (e.g., gpt-4)",
                "tags": [
                    "models"
                ],
                "summary": "Update model by model ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model ID (e.g., gpt-4)",
                        "name": "modelId",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Updated model configuration",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a model configuration by its model_id field (e.g., gpt-4)",
                "tags": [
                    "models"
                ],
                "summary": "Delete model by model ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model ID (e.g., gpt-4)",
                        "name": "modelId",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/models/{id}": {
            "get": {
                "description": "Get a model configuration by its internal UUID",
                "tags": [
                    "models"
                ],
                "summary": "Get model by internal ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model internal ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update a model configuration by its internal UUID",
                "tags": [
                    "models"
                ],
                "summary": "Update model by internal ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model internal ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Updated model configuration",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/models.UpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a model configuration by its internal UUID",
                "tags": [
                    "models"
                ],
                "summary": "Delete model by internal ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Model internal ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/providers": {
            "get": {
                "description": "Get a list of all configured LLM providers, optionally filtered by client type",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "List all LLM providers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Client type filter (openai, openai-compat, anthropic, google, azure, bedrock, mistral, xai, ollama, dashscope)",
                        "name": "client_type",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/providers.GetResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new LLM provider configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Create a new LLM provider",
                "parameters": [
                    {
                        "description": "Provider configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/providers.CreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/providers.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/providers/count": {
            "get": {
                "description": "Get the total count of providers, optionally filtered by client type",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Count providers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Client type filter (openai, openai-compat, anthropic, google, azure, bedrock, mistral, xai, ollama, dashscope)",
                        "name": "client_type",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/providers.CountResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/providers/name/{name}": {
            "get": {
                "description": "Get a provider configuration by its name",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Get provider by name",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider name",
                        "name": "name",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/providers.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/providers/{id}": {
            "get": {
                "description": "Get a provider configuration by its ID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Get provider by ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/providers.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update an existing provider configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Update provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Updated provider configuration",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/providers.UpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/providers.GetResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete a provider configuration",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "providers"
                ],
                "summary": "Delete provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/providers/{id}/models": {
            "get": {
                "description": "Get models for a provider by id, optionally filtered by type",
                "tags": [
                    "providers"
                ],
                "summary": "List provider models",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Provider ID (UUID)",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Model type (chat, embedding)",
                        "name": "type",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.GetResponse"
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users": {
            "get": {
                "description": "List users",
                "tags": [
                    "users"
                ],
                "summary": "List users (admin only)",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/accounts.ListAccountsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new human user account",
                "tags": [
                    "users"
                ],
                "summary": "Create human user (admin only)",
                "parameters": [
                    {
                        "description": "User payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/accounts.CreateAccountRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/accounts.Account"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/me": {
            "get": {
                "description": "Get current user profile",
                "tags": [
                    "users"
                ],
                "summary": "Get current user",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/accounts.Account"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update current user display name or avatar",
                "tags": [
                    "users"
                ],
                "summary": "Update current user profile",
                "parameters": [
                    {
                        "description": "Profile payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/accounts.UpdateProfileRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/accounts.Account"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/me/channels/{platform}": {
            "get": {
                "description": "Get channel binding configuration for current user",
                "tags": [
                    "channel"
                ],
                "summary": "Get channel user config",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/channel.ChannelIdentityBinding"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update channel binding configuration for current user",
                "tags": [
                    "channel"
                ],
                "summary": "Update channel user config",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Channel platform",
                        "name": "platform",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Channel user config payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/channel.UpsertChannelIdentityConfigRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/channel.ChannelIdentityBinding"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/me/identities": {
            "get": {
                "description": "List all channel identities linked to current user",
                "tags": [
                    "users"
                ],
                "summary": "List current user's channel identities",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.listMyIdentitiesResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/me/password": {
            "put": {
                "description": "Update current user password with current password check",
                "tags": [
                    "users"
                ],
                "summary": "Update current user password",
                "parameters": [
                    {
                        "description": "Password payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/accounts.UpdatePasswordRequest"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/{id}": {
            "get": {
                "description": "Get user details (self or admin only)",
                "tags": [
                    "users"
                ],
                "summary": "Get user by ID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/accounts.Account"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "put": {
                "description": "Update user profile and status",
                "tags": [
                    "users"
                ],
                "summary": "Update user (admin only)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "User update payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/accounts.UpdateAccountRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/accounts.Account"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/users/{id}/password": {
            "put": {
                "description": "Reset a user password",
                "tags": [
                    "users"
                ],
                "summary": "Reset user password (admin only)",
                "parameters": [
                    {
                        "type": "string",
                        "description": "User ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Password payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/accounts.ResetPasswordRequest"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "accounts.Account": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "last_login_at": {
                    "type": "string"
                },
                "role": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                }
            }
        },
        "accounts.CreateAccountRequest": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "password": {
                    "type": "string"
                },
                "role": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                }
            }
        },
        "accounts.ListAccountsResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/accounts.Account"
                    }
                }
            }
        },
        "accounts.ResetPasswordRequest": {
            "type": "object",
            "properties": {
                "new_password": {
                    "type": "string"
                }
            }
        },
        "accounts.UpdateAccountRequest": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "role": {
                    "type": "string"
                }
            }
        },
        "accounts.UpdatePasswordRequest": {
            "type": "object",
            "properties": {
                "current_password": {
                    "type": "string"
                },
                "new_password": {
                    "type": "string"
                }
            }
        },
        "accounts.UpdateProfileRequest": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                }
            }
        },
        "bots.Bot": {
            "type": "object",
            "properties": {
                "allow_guest": {
                    "type": "boolean"
                },
                "avatar_url": {
                    "type": "string"
                },
                "check_issue_count": {
                    "type": "integer"
                },
                "check_state": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "owner_user_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "bots.BotCheck": {
            "type": "object",
            "properties": {
                "check_key": {
                    "type": "string"
                },
                "detail": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                },
                "summary": {
                    "type": "string"
                }
            }
        },
        "bots.BotMember": {
            "type": "object",
            "properties": {
                "bot_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "role": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "bots.CreateBotRequest": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "type": {
                    "type": "string"
                }
            }
        },
        "bots.ListBotsResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/bots.Bot"
                    }
                }
            }
        },
        "bots.ListCheckKeysResponse": {
            "type": "object",
            "properties": {
                "keys": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "bots.ListChecksResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/bots.BotCheck"
                    }
                }
            }
        },
        "bots.ListMembersResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/bots.BotMember"
                    }
                }
            }
        },
        "bots.TransferBotRequest": {
            "type": "object",
            "properties": {
                "owner_user_id": {
                    "type": "string"
                }
            }
        },
        "bots.UpdateBotRequest": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "bots.UpsertMemberRequest": {
            "type": "object",
            "properties": {
                "role": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "channel.Action": {
            "type": "object",
            "properties": {
                "label": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            }
        },
        "channel.Attachment": {
            "type": "object",
            "properties": {
                "caption": {
                    "type": "string"
                },
                "duration_ms": {
                    "type": "integer"
                },
                "height": {
                    "type": "integer"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "mime": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "platform_key": {
                    "type": "string"
                },
                "size": {
                    "type": "integer"
                },
                "source_platform": {
                    "type": "string"
                },
                "thumbnail_url": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/channel.AttachmentType"
                },
                "url": {
                    "type": "string"
                },
                "width": {
                    "type": "integer"
                }
            }
        },
        "channel.AttachmentType": {
            "type": "string",
            "enum": [
                "image",
                "audio",
                "video",
                "voice",
                "file",
                "gif"
            ],
            "x-enum-varnames": [
                "AttachmentImage",
                "AttachmentAudio",
                "AttachmentVideo",
                "AttachmentVoice",
                "AttachmentFile",
                "AttachmentGIF"
            ]
        },
        "channel.ChannelCapabilities": {
            "type": "object",
            "properties": {
                "attachments": {
                    "type": "boolean"
                },
                "block_streaming": {
                    "type": "boolean"
                },
                "buttons": {
                    "type": "boolean"
                },
                "chat_types": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "edit": {
                    "type": "boolean"
                },
                "markdown": {
                    "type": "boolean"
                },
                "media": {
                    "type": "boolean"
                },
                "native_commands": {
                    "type": "boolean"
                },
                "polls": {
                    "type": "boolean"
                },
                "reactions": {
                    "type": "boolean"
                },
                "reply": {
                    "type": "boolean"
                },
                "rich_text": {
                    "type": "boolean"
                },
                "streaming": {
                    "type": "boolean"
                },
                "text": {
                    "type": "boolean"
                },
                "threads": {
                    "type": "boolean"
                },
                "unsend": {
                    "type": "boolean"
                }
            }
        },
        "channel.ChannelConfig": {
            "type": "object",
            "properties": {
                "botID": {
                    "type": "string"
                },
                "channelType": {
                    "type": "string"
                },
                "createdAt": {
                    "type": "string"
                },
                "credentials": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "externalIdentity": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "routing": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "selfIdentity": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                },
                "verifiedAt": {
                    "type": "string"
                }
            }
        },
        "channel.ChannelIdentityBinding": {
            "type": "object",
            "properties": {
                "channelIdentityID": {
                    "type": "string"
                },
                "channelType": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "createdAt": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "channel.ConfigSchema": {
            "type": "object",
            "properties": {
                "fields": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/channel.FieldSchema"
                    }
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "channel.FieldSchema": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "enum": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "example": {},
                "required": {
                    "type": "boolean"
                },
                "title": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/channel.FieldType"
                }
            }
        },
        "channel.FieldType": {
            "type": "string",
            "enum": [
                "string",
                "secret",
                "bool",
                "number",
                "enum"
            ],
            "x-enum-varnames": [
                "FieldString",
                "FieldSecret",
                "FieldBool",
                "FieldNumber",
                "FieldEnum"
            ]
        },
        "channel.Message": {
            "type": "object",
            "properties": {
                "actions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/channel.Action"
                    }
                },
                "attachments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/channel.Attachment"
                    }
                },
                "format": {
                    "$ref": "#/definitions/channel.MessageFormat"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "parts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/channel.MessagePart"
                    }
                },
                "reply": {
                    "$ref": "#/definitions/channel.ReplyRef"
                },
                "text": {
                    "type": "string"
                },
                "thread": {
                    "$ref": "#/definitions/channel.ThreadRef"
                }
            }
        },
        "channel.MessageFormat": {
            "type": "string",
            "enum": [
                "plain",
                "markdown",
                "rich"
            ],
            "x-enum-varnames": [
                "MessageFormatPlain",
                "MessageFormatMarkdown",
                "MessageFormatRich"
            ]
        },
        "channel.MessagePart": {
            "type": "object",
            "properties": {
                "channel_identity_id": {
                    "type": "string"
                },
                "emoji": {
                    "type": "string"
                },
                "language": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "styles": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/channel.MessageTextStyle"
                    }
                },
                "text": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/channel.MessagePartType"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "channel.MessagePartType": {
            "type": "string",
            "enum": [
                "text",
                "link",
                "code_block",
                "mention",
                "emoji"
            ],
            "x-enum-varnames": [
                "MessagePartText",
                "MessagePartLink",
                "MessagePartCodeBlock",
                "MessagePartMention",
                "MessagePartEmoji"
            ]
        },
        "channel.MessageTextStyle": {
            "type": "string",
            "enum": [
                "bold",
                "italic",
                "strikethrough",
                "code"
            ],
            "x-enum-varnames": [
                "MessageStyleBold",
                "MessageStyleItalic",
                "MessageStyleStrikethrough",
                "MessageStyleCode"
            ]
        },
        "channel.ReplyRef": {
            "type": "object",
            "properties": {
                "message_id": {
                    "type": "string"
                },
                "target": {
                    "type": "string"
                }
            }
        },
        "channel.SendRequest": {
            "type": "object",
            "properties": {
                "channel_identity_id": {
                    "type": "string"
                },
                "message": {
                    "$ref": "#/definitions/channel.Message"
                },
                "target": {
                    "type": "string"
                }
            }
        },
        "channel.TargetHint": {
            "type": "object",
            "properties": {
                "example": {
                    "type": "string"
                },
                "label": {
                    "type": "string"
                }
            }
        },
        "channel.TargetSpec": {
            "type": "object",
            "properties": {
                "format": {
                    "type": "string"
                },
                "hints": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/channel.TargetHint"
                    }
                }
            }
        },
        "channel.ThreadRef": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                }
            }
        },
        "channel.UpsertChannelIdentityConfigRequest": {
            "type": "object",
            "properties": {
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                }
            }
        },
        "channel.UpsertConfigRequest": {
            "type": "object",
            "properties": {
                "credentials": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "external_identity": {
                    "type": "string"
                },
                "routing": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "self_identity": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "status": {
                    "type": "string"
                },
                "verified_at": {
                    "type": "string"
                }
            }
        },
        "github_com_memohai_memoh_internal_mcp.Connection": {
            "type": "object",
            "properties": {
                "bot_id": {
                    "type": "string"
                },
                "config": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "is_active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.BatchDeleteRequest": {
            "type": "object",
            "properties": {
                "ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "handlers.ChannelMeta": {
            "type": "object",
            "properties": {
                "capabilities": {
                    "$ref": "#/definitions/channel.ChannelCapabilities"
                },
                "config_schema": {
                    "$ref": "#/definitions/channel.ConfigSchema"
                },
                "configless": {
                    "type": "boolean"
                },
                "display_name": {
                    "type": "string"
                },
                "target_spec": {
                    "$ref": "#/definitions/channel.TargetSpec"
                },
                "type": {
                    "type": "string"
                },
                "user_config_schema": {
                    "$ref": "#/definitions/channel.ConfigSchema"
                }
            }
        },
        "handlers.CreateContainerRequest": {
            "type": "object",
            "properties": {
                "snapshotter": {
                    "type": "string"
                }
            }
        },
        "handlers.CreateContainerResponse": {
            "type": "object",
            "properties": {
                "container_id": {
                    "type": "string"
                },
                "image": {
                    "type": "string"
                },
                "snapshotter": {
                    "type": "string"
                },
                "started": {
                    "type": "boolean"
                }
            }
        },
        "handlers.CreateSnapshotRequest": {
            "type": "object",
            "properties": {
                "snapshot_name": {
                    "type": "string"
                }
            }
        },
        "handlers.CreateSnapshotResponse": {
            "type": "object",
            "properties": {
                "container_id": {
                    "type": "string"
                },
                "snapshot_name": {
                    "type": "string"
                },
                "snapshotter": {
                    "type": "string"
                }
            }
        },
        "handlers.EmbeddingsInput": {
            "type": "object",
            "properties": {
                "image_url": {
                    "type": "string"
                },
                "text": {
                    "type": "string"
                },
                "video_url": {
                    "type": "string"
                }
            }
        },
        "handlers.EmbeddingsRequest": {
            "type": "object",
            "properties": {
                "dimensions": {
                    "type": "integer"
                },
                "input": {
                    "$ref": "#/definitions/handlers.EmbeddingsInput"
                },
                "model": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                }
            }
        },
        "handlers.EmbeddingsResponse": {
            "type": "object",
            "properties": {
                "dimensions": {
                    "type": "integer"
                },
                "embedding": {
                    "type": "array",
                    "items": {
                        "type": "number"
                    }
                },
                "message": {
                    "type": "string"
                },
                "model": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "usage": {
                    "$ref": "#/definitions/handlers.EmbeddingsUsage"
                }
            }
        },
        "handlers.EmbeddingsUsage": {
            "type": "object",
            "properties": {
                "duration": {
                    "type": "integer"
                },
                "image_tokens": {
                    "type": "integer"
                },
                "input_tokens": {
                    "type": "integer"
                }
            }
        },
        "handlers.ErrorResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        },
        "handlers.GetContainerResponse": {
            "type": "object",
            "properties": {
                "container_id": {
                    "type": "string"
                },
                "container_path": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "host_path": {
                    "type": "string"
                },
                "image": {
                    "type": "string"
                },
                "namespace": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "task_running": {
                    "type": "boolean"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.ListSnapshotsResponse": {
            "type": "object",
            "properties": {
                "snapshots": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SnapshotInfo"
                    }
                },
                "snapshotter": {
                    "type": "string"
                }
            }
        },
        "handlers.LoginRequest": {
            "type": "object",
            "properties": {
                "password": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                }
            }
        },
        "handlers.LoginResponse": {
            "type": "object",
            "properties": {
                "access_token": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "role": {
                    "type": "string"
                },
                "token_type": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                },
                "username": {
                    "type": "string"
                }
            }
        },
        "handlers.MCPStdioRequest": {
            "type": "object",
            "properties": {
                "args": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "command": {
                    "type": "string"
                },
                "cwd": {
                    "type": "string"
                },
                "env": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "handlers.MCPStdioResponse": {
            "type": "object",
            "properties": {
                "connection_id": {
                    "type": "string"
                },
                "tools": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "handlers.SkillItem": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "handlers.SkillsDeleteRequest": {
            "type": "object",
            "properties": {
                "names": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "handlers.SkillsResponse": {
            "type": "object",
            "properties": {
                "skills": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SkillItem"
                    }
                }
            }
        },
        "handlers.SkillsUpsertRequest": {
            "type": "object",
            "properties": {
                "skills": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SkillItem"
                    }
                }
            }
        },
        "handlers.SnapshotInfo": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "kind": {
                    "type": "string"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "name": {
                    "type": "string"
                },
                "parent": {
                    "type": "string"
                },
                "snapshotter": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.listMyIdentitiesResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/identities.ChannelIdentity"
                    }
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "handlers.memoryAddPayload": {
            "type": "object",
            "properties": {
                "embedding_enabled": {
                    "type": "boolean"
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "infer": {
                    "type": "boolean"
                },
                "message": {
                    "type": "string"
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/memory.Message"
                    }
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "namespace": {
                    "type": "string"
                },
                "run_id": {
                    "type": "string"
                }
            }
        },
        "handlers.memoryCompactPayload": {
            "type": "object",
            "properties": {
                "decay_days": {
                    "type": "integer"
                },
                "ratio": {
                    "type": "number"
                }
            }
        },
        "handlers.memoryDeletePayload": {
            "type": "object",
            "properties": {
                "memory_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "handlers.memorySearchPayload": {
            "type": "object",
            "properties": {
                "embedding_enabled": {
                    "type": "boolean"
                },
                "filters": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "limit": {
                    "type": "integer"
                },
                "query": {
                    "type": "string"
                },
                "run_id": {
                    "type": "string"
                },
                "sources": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "handlers.skillsOpResponse": {
            "type": "object",
            "properties": {
                "ok": {
                    "type": "boolean"
                }
            }
        },
        "identities.ChannelIdentity": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string"
                },
                "channel": {
                    "type": "string"
                },
                "channel_subject_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "updated_at": {
                    "type": "string"
                },
                "user_id": {
                    "type": "string"
                }
            }
        },
        "mcp.ExportResponse": {
            "type": "object",
            "properties": {
                "mcpServers": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/mcp.MCPServerEntry"
                    }
                }
            }
        },
        "mcp.ImportRequest": {
            "type": "object",
            "properties": {
                "mcpServers": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/mcp.MCPServerEntry"
                    }
                }
            }
        },
        "mcp.ListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
                    }
                }
            }
        },
        "mcp.MCPServerEntry": {
            "type": "object",
            "properties": {
                "args": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "command": {
                    "type": "string"
                },
                "cwd": {
                    "type": "string"
                },
                "env": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "headers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "transport": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "mcp.UpsertRequest": {
            "type": "object",
            "properties": {
                "args": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "command": {
                    "type": "string"
                },
                "cwd": {
                    "type": "string"
                },
                "env": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "headers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "is_active": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "transport": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "memory.CompactResult": {
            "type": "object",
            "properties": {
                "after_count": {
                    "type": "integer"
                },
                "before_count": {
                    "type": "integer"
                },
                "ratio": {
                    "type": "number"
                },
                "results": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/memory.MemoryItem"
                    }
                }
            }
        },
        "memory.DeleteResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string"
                }
            }
        },
        "memory.MemoryItem": {
            "type": "object",
            "properties": {
                "agent_id": {
                    "type": "string"
                },
                "bot_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "hash": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "run_id": {
                    "type": "string"
                },
                "score": {
                    "type": "number"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "memory.Message": {
            "type": "object",
            "properties": {
                "content": {
                    "type": "string"
                },
                "role": {
                    "type": "string"
                }
            }
        },
        "memory.RebuildResult": {
            "type": "object",
            "properties": {
                "fs_count": {
                    "type": "integer"
                },
                "missing_count": {
                    "type": "integer"
                },
                "qdrant_count": {
                    "type": "integer"
                },
                "restored_count": {
                    "type": "integer"
                }
            }
        },
        "memory.SearchResponse": {
            "type": "object",
            "properties": {
                "relations": {
                    "type": "array",
                    "items": {}
                },
                "results": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/memory.MemoryItem"
                    }
                }
            }
        },
        "memory.UsageResponse": {
            "type": "object",
            "properties": {
                "avg_text_bytes": {
                    "type": "integer"
                },
                "count": {
                    "type": "integer"
                },
                "estimated_storage_bytes": {
                    "type": "integer"
                },
                "total_text_bytes": {
                    "type": "integer"
                }
            }
        },
        "models.AddRequest": {
            "type": "object",
            "properties": {
                "dimensions": {
                    "type": "integer"
                },
                "input": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "is_multimodal": {
                    "type": "boolean"
                },
                "llm_provider_id": {
                    "type": "string"
                },
                "model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/models.ModelType"
                }
            }
        },
        "models.AddResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "model_id": {
                    "type": "string"
                }
            }
        },
        "models.CountResponse": {
            "type": "object",
            "properties": {
                "count": {
                    "type": "integer"
                }
            }
        },
        "models.GetResponse": {
            "type": "object",
            "properties": {
                "dimensions": {
                    "type": "integer"
                },
                "input": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "is_multimodal": {
                    "type": "boolean"
                },
                "llm_provider_id": {
                    "type": "string"
                },
                "model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/models.ModelType"
                }
            }
        },
        "models.ModelType": {
            "type": "string",
            "enum": [
                "chat",
                "embedding"
            ],
            "x-enum-varnames": [
                "ModelTypeChat",
                "ModelTypeEmbedding"
            ]
        },
        "models.UpdateRequest": {
            "type": "object",
            "properties": {
                "dimensions": {
                    "type": "integer"
                },
                "input": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "is_multimodal": {
                    "type": "boolean"
                },
                "llm_provider_id": {
                    "type": "string"
                },
                "model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/models.ModelType"
                }
            }
        },
        "providers.ClientType": {
            "type": "string",
            "enum": [
                "openai",
                "openai-compat",
                "anthropic",
                "google",
                "azure",
                "bedrock",
                "mistral",
                "xai",
                "ollama",
                "dashscope"
            ],
            "x-enum-varnames": [
                "ClientTypeOpenAI",
                "ClientTypeOpenAICompat",
                "ClientTypeAnthropic",
                "ClientTypeGoogle",
                "ClientTypeAzure",
                "ClientTypeBedrock",
                "ClientTypeMistral",
                "ClientTypeXAI",
                "ClientTypeOllama",
                "ClientTypeDashscope"
            ]
        },
        "providers.CountResponse": {
            "type": "object",
            "properties": {
                "count": {
                    "type": "integer"
                }
            }
        },
        "providers.CreateRequest": {
            "type": "object",
            "required": [
                "base_url",
                "client_type",
                "name"
            ],
            "properties": {
                "api_key": {
                    "type": "string"
                },
                "base_url": {
                    "type": "string"
                },
                "client_type": {
                    "$ref": "#/definitions/providers.ClientType"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "providers.GetResponse": {
            "type": "object",
            "properties": {
                "api_key": {
                    "description": "masked in response",
                    "type": "string"
                },
                "base_url": {
                    "type": "string"
                },
                "client_type": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "providers.UpdateRequest": {
            "type": "object",
            "properties": {
                "api_key": {
                    "type": "string"
                },
                "base_url": {
                    "type": "string"
                },
                "client_type": {
                    "$ref": "#/definitions/providers.ClientType"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "schedule.CreateRequest": {
            "type": "object",
            "properties": {
                "command": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "enabled": {
                    "type": "boolean"
                },
                "max_calls": {
                    "$ref": "#/definitions/schedule.NullableInt"
                },
                "name": {
                    "type": "string"
                },
                "pattern": {
                    "type": "string"
                }
            }
        },
        "schedule.ListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/schedule.Schedule"
                    }
                }
            }
        },
        "schedule.NullableInt": {
            "type": "object",
            "properties": {
                "set": {
                    "type": "boolean"
                },
                "value": {
                    "type": "integer"
                }
            }
        },
        "schedule.Schedule": {
            "type": "object",
            "properties": {
                "bot_id": {
                    "type": "string"
                },
                "command": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "current_calls": {
                    "type": "integer"
                },
                "description": {
                    "type": "string"
                },
                "enabled": {
                    "type": "boolean"
                },
                "id": {
                    "type": "string"
                },
                "max_calls": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "pattern": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "schedule.UpdateRequest": {
            "type": "object",
            "properties": {
                "command": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "enabled": {
                    "type": "boolean"
                },
                "max_calls": {
                    "$ref": "#/definitions/schedule.NullableInt"
                },
                "name": {
                    "type": "string"
                },
                "pattern": {
                    "type": "string"
                }
            }
        },
        "settings.Settings": {
            "type": "object",
            "properties": {
                "allow_guest": {
                    "type": "boolean"
                },
                "chat_model_id": {
                    "type": "string"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "language": {
                    "type": "string"
                },
                "max_context_load_time": {
                    "type": "integer"
                },
                "memory_model_id": {
                    "type": "string"
                }
            }
        },
        "settings.UpsertRequest": {
            "type": "object",
            "properties": {
                "allow_guest": {
                    "type": "boolean"
                },
                "chat_model_id": {
                    "type": "string"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "language": {
                    "type": "string"
                },
                "max_context_load_time": {
                    "type": "integer"
                },
                "memory_model_id": {
                    "type": "string"
                }
            }
        },
        "subagent.AddSkillsRequest": {
            "type": "object",
            "properties": {
                "skills": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "subagent.ContextResponse": {
            "type": "object",
            "properties": {
                "messages": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                }
            }
        },
        "subagent.CreateRequest": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "skills": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "subagent.ListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/subagent.Subagent"
                    }
                }
            }
        },
        "subagent.SkillsResponse": {
            "type": "object",
            "properties": {
                "skills": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "subagent.Subagent": {
            "type": "object",
            "properties": {
                "bot_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "deleted": {
                    "type": "boolean"
                },
                "deleted_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                },
                "skills": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "subagent.UpdateContextRequest": {
            "type": "object",
            "properties": {
                "messages": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": {}
                    }
                }
            }
        },
        "subagent.UpdateRequest": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "subagent.UpdateSkillsRequest": {
            "type": "object",
            "properties": {
                "skills": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        }
    }
}