Files
Memoh/docs/swagger.yaml
T
BBQ 6aebbe9279 feat: refactor User/Bot architecture and implement multi-channel gateway
Major changes:
1. Core Architecture: Decoupled Bots from Users. Bots now have independent lifecycles, member management (bot_members), and dedicated configurations.
2. Channel Gateway:
   - Implemented a unified Channel Manager supporting Feishu, Telegram, and Local (Web/CLI) adapters.
   - Added message processing pipeline to normalize interactions across different platforms.
   - Introduced a Contact system for identity binding and guest access policies.
3. Database & Tooling:
   - Consolidated all migrations into 0001_init with updated schema for bots, channels, and contacts.
   - Optimized sqlc.yaml to automatically track the migrations directory.
4. Agent Enhancements:
   - Introduced ToolContext to provide Agents with platform-aware execution capabilities (e.g., messaging, contact lookups).
   - Added tool logging and fallback mechanisms for toolChoice execution.
5. UI & Docs: Updated frontend stores, UI components, and Swagger documentation to align with the new Bot-centric model.
2026-02-04 23:49:50 +08:00

3597 lines
90 KiB
YAML

definitions:
bots.Bot:
properties:
avatar_url:
type: string
created_at:
type: string
display_name:
type: string
id:
type: string
is_active:
type: boolean
metadata:
additionalProperties: true
type: object
owner_user_id:
type: string
type:
type: string
updated_at:
type: string
type: object
bots.BotMember:
properties:
bot_id:
type: string
created_at:
type: string
role:
type: string
user_id:
type: string
type: object
bots.CreateBotRequest:
properties:
avatar_url:
type: string
display_name:
type: string
is_active:
type: boolean
metadata:
additionalProperties: true
type: object
type:
type: string
type: object
bots.ListBotsResponse:
properties:
items:
items:
$ref: '#/definitions/bots.Bot'
type: array
type: object
bots.ListMembersResponse:
properties:
items:
items:
$ref: '#/definitions/bots.BotMember'
type: array
type: object
bots.TransferBotRequest:
properties:
owner_user_id:
type: string
type: object
bots.UpdateBotRequest:
properties:
avatar_url:
type: string
display_name:
type: string
is_active:
type: boolean
metadata:
additionalProperties: true
type: object
type: object
bots.UpsertMemberRequest:
properties:
role:
type: string
user_id:
type: string
type: object
channel.ChannelConfig:
properties:
botID:
type: string
capabilities:
additionalProperties: true
type: object
channelType:
$ref: '#/definitions/channel.ChannelType'
createdAt:
type: string
credentials:
additionalProperties: true
type: object
externalIdentity:
type: string
id:
type: string
routing:
additionalProperties: true
type: object
selfIdentity:
additionalProperties: true
type: object
status:
type: string
updatedAt:
type: string
verifiedAt:
type: string
type: object
channel.ChannelType:
enum:
- telegram
- feishu
- cli
- web
type: string
x-enum-varnames:
- ChannelTelegram
- ChannelFeishu
- ChannelCLI
- ChannelWeb
channel.ChannelUserBinding:
properties:
channelType:
$ref: '#/definitions/channel.ChannelType'
config:
additionalProperties: true
type: object
createdAt:
type: string
id:
type: string
updatedAt:
type: string
userID:
type: string
type: object
channel.SendRequest:
properties:
message:
type: string
to:
type: string
to_user_id:
type: string
type: object
channel.UpsertConfigRequest:
properties:
capabilities:
additionalProperties: true
type: object
credentials:
additionalProperties: true
type: object
external_identity:
type: string
routing:
additionalProperties: true
type: object
self_identity:
additionalProperties: true
type: object
status:
type: string
verified_at:
type: string
type: object
channel.UpsertUserConfigRequest:
properties:
config:
additionalProperties: true
type: object
type: object
chat.AgentSkill:
properties:
content:
type: string
description:
type: string
name:
type: string
type: object
chat.ChatRequest:
properties:
current_platform:
type: string
language:
type: string
locale:
type: string
max_context_load_time:
type: integer
max_steps:
type: integer
messages:
items:
$ref: '#/definitions/chat.GatewayMessage'
type: array
model:
type: string
platforms:
items:
type: string
type: array
provider:
type: string
query:
type: string
skills:
items:
$ref: '#/definitions/chat.AgentSkill'
type: array
toolChoice:
additionalProperties: {}
type: object
toolContext:
$ref: '#/definitions/chat.ToolContext'
use_skills:
items:
type: string
type: array
type: object
chat.ChatResponse:
properties:
messages:
items:
$ref: '#/definitions/chat.GatewayMessage'
type: array
model:
type: string
provider:
type: string
skills:
items:
type: string
type: array
type: object
chat.GatewayMessage:
additionalProperties: true
type: object
chat.ToolContext:
properties:
botId:
type: string
contactAlias:
type: string
contactId:
type: string
contactName:
type: string
currentPlatform:
type: string
replyTarget:
type: string
sessionId:
type: string
sessionToken:
type: string
userId:
type: string
type: object
handlers.ContainerInfo:
properties:
created_at:
type: string
id:
type: string
image:
type: string
labels:
additionalProperties:
type: string
type: object
snapshot_key:
type: string
snapshotter:
type: string
updated_at:
type: string
type: object
handlers.CreateContainerRequest:
properties:
container_id:
type: string
image:
type: string
snapshotter:
type: string
type: object
handlers.CreateContainerResponse:
properties:
container_id:
type: string
image:
type: string
snapshotter:
type: string
started:
type: boolean
type: object
handlers.CreateSnapshotRequest:
properties:
container_id:
type: string
snapshot_name:
type: string
type: object
handlers.CreateSnapshotResponse:
properties:
container_id:
type: string
snapshot_name:
type: string
snapshotter:
type: string
type: object
handlers.EmbeddingsInput:
properties:
image_url:
type: string
text:
type: string
video_url:
type: string
type: object
handlers.EmbeddingsRequest:
properties:
dimensions:
type: integer
input:
$ref: '#/definitions/handlers.EmbeddingsInput'
model:
type: string
provider:
type: string
type:
type: string
type: object
handlers.EmbeddingsResponse:
properties:
dimensions:
type: integer
embedding:
items:
type: number
type: array
message:
type: string
model:
type: string
provider:
type: string
type:
type: string
usage:
$ref: '#/definitions/handlers.EmbeddingsUsage'
type: object
handlers.EmbeddingsUsage:
properties:
image_tokens:
type: integer
input_tokens:
type: integer
video_tokens:
type: integer
type: object
handlers.EnableModelRequest:
properties:
as:
type: string
model_id:
type: string
type: object
handlers.ErrorResponse:
properties:
message:
type: string
type: object
handlers.ListContainersResponse:
properties:
containers:
items:
$ref: '#/definitions/handlers.ContainerInfo'
type: array
type: object
handlers.ListSnapshotsResponse:
properties:
snapshots:
items:
$ref: '#/definitions/handlers.SnapshotInfo'
type: array
snapshotter:
type: string
type: object
handlers.LoginRequest:
properties:
password:
type: string
username:
type: string
type: object
handlers.LoginResponse:
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
type: object
handlers.SkillItem:
properties:
content:
type: string
description:
type: string
name:
type: string
type: object
handlers.SkillsDeleteRequest:
properties:
names:
items:
type: string
type: array
type: object
handlers.SkillsResponse:
properties:
skills:
items:
$ref: '#/definitions/handlers.SkillItem'
type: array
type: object
handlers.SkillsUpsertRequest:
properties:
skills:
items:
$ref: '#/definitions/handlers.SkillItem'
type: array
type: object
handlers.SnapshotInfo:
properties:
created_at:
type: string
kind:
type: string
labels:
additionalProperties:
type: string
type: object
name:
type: string
parent:
type: string
snapshotter:
type: string
updated_at:
type: string
type: object
handlers.memoryAddPayload:
properties:
embedding_enabled:
type: boolean
filters:
additionalProperties: true
type: object
infer:
type: boolean
message:
type: string
messages:
items:
$ref: '#/definitions/memory.Message'
type: array
metadata:
additionalProperties: true
type: object
run_id:
type: string
type: object
handlers.memoryDeleteAllPayload:
properties:
run_id:
type: string
type: object
handlers.memoryEmbedUpsertPayload:
properties:
filters:
additionalProperties: true
type: object
input:
$ref: '#/definitions/memory.EmbedInput'
metadata:
additionalProperties: true
type: object
model:
type: string
provider:
type: string
run_id:
type: string
source:
type: string
type:
type: string
type: object
handlers.memorySearchPayload:
properties:
embedding_enabled:
type: boolean
filters:
additionalProperties: true
type: object
limit:
type: integer
query:
type: string
run_id:
type: string
sources:
items:
type: string
type: array
type: object
handlers.skillsOpResponse:
properties:
ok:
type: boolean
type: object
history.CreateRequest:
properties:
messages:
items:
additionalProperties: true
type: object
type: array
skills:
items:
type: string
type: array
type: object
history.ListResponse:
properties:
items:
items:
$ref: '#/definitions/history.Record'
type: array
type: object
history.Record:
properties:
bot_id:
type: string
id:
type: string
messages:
items:
additionalProperties: true
type: object
type: array
session_id:
type: string
skills:
items:
type: string
type: array
timestamp:
type: string
type: object
memory.DeleteResponse:
properties:
message:
type: string
type: object
memory.EmbedInput:
properties:
image_url:
type: string
text:
type: string
video_url:
type: string
type: object
memory.EmbedUpsertResponse:
properties:
dimensions:
type: integer
item:
$ref: '#/definitions/memory.MemoryItem'
model:
type: string
provider:
type: string
type: object
memory.MemoryItem:
properties:
agentId:
type: string
botId:
type: string
createdAt:
type: string
hash:
type: string
id:
type: string
memory:
type: string
metadata:
additionalProperties: true
type: object
runId:
type: string
score:
type: number
sessionId:
type: string
updatedAt:
type: string
type: object
memory.Message:
properties:
content:
type: string
role:
type: string
type: object
memory.SearchResponse:
properties:
relations:
items: {}
type: array
results:
items:
$ref: '#/definitions/memory.MemoryItem'
type: array
type: object
memory.UpdateRequest:
properties:
embedding_enabled:
type: boolean
memory:
type: string
memory_id:
type: string
type: object
models.AddRequest:
properties:
dimensions:
type: integer
is_multimodal:
type: boolean
llm_provider_id:
type: string
model_id:
type: string
name:
type: string
type:
$ref: '#/definitions/models.ModelType'
type: object
models.AddResponse:
properties:
id:
type: string
model_id:
type: string
type: object
models.CountResponse:
properties:
count:
type: integer
type: object
models.GetResponse:
properties:
dimensions:
type: integer
is_multimodal:
type: boolean
llm_provider_id:
type: string
model_id:
type: string
name:
type: string
type:
$ref: '#/definitions/models.ModelType'
type: object
models.ModelType:
enum:
- chat
- embedding
type: string
x-enum-varnames:
- ModelTypeChat
- ModelTypeEmbedding
models.UpdateRequest:
properties:
dimensions:
type: integer
is_multimodal:
type: boolean
llm_provider_id:
type: string
model_id:
type: string
name:
type: string
type:
$ref: '#/definitions/models.ModelType'
type: object
providers.ClientType:
enum:
- openai
- openai-compat
- anthropic
- google
- ollama
type: string
x-enum-varnames:
- ClientTypeOpenAI
- ClientTypeOpenAICompat
- ClientTypeAnthropic
- ClientTypeGoogle
- ClientTypeOllama
providers.CountResponse:
properties:
count:
type: integer
type: object
providers.CreateRequest:
properties:
api_key:
type: string
base_url:
type: string
client_type:
$ref: '#/definitions/providers.ClientType'
metadata:
additionalProperties: true
type: object
name:
type: string
required:
- base_url
- client_type
- name
type: object
providers.GetResponse:
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:
additionalProperties: true
type: object
name:
type: string
updated_at:
type: string
type: object
providers.UpdateRequest:
properties:
api_key:
type: string
base_url:
type: string
client_type:
$ref: '#/definitions/providers.ClientType'
metadata:
additionalProperties: true
type: object
name:
type: string
type: object
schedule.CreateRequest:
properties:
command:
type: string
description:
type: string
enabled:
type: boolean
max_calls:
$ref: '#/definitions/schedule.NullableInt'
name:
type: string
pattern:
type: string
type: object
schedule.ListResponse:
properties:
items:
items:
$ref: '#/definitions/schedule.Schedule'
type: array
type: object
schedule.NullableInt:
properties:
set:
type: boolean
value:
type: integer
type: object
schedule.Schedule:
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
type: object
schedule.UpdateRequest:
properties:
command:
type: string
description:
type: string
enabled:
type: boolean
max_calls:
$ref: '#/definitions/schedule.NullableInt'
name:
type: string
pattern:
type: string
type: object
settings.Settings:
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
type: object
settings.UpsertRequest:
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
type: object
subagent.AddSkillsRequest:
properties:
skills:
items:
type: string
type: array
type: object
subagent.ContextResponse:
properties:
messages:
items:
additionalProperties: true
type: object
type: array
type: object
subagent.CreateRequest:
properties:
description:
type: string
messages:
items:
additionalProperties: true
type: object
type: array
metadata:
additionalProperties: true
type: object
name:
type: string
skills:
items:
type: string
type: array
type: object
subagent.ListResponse:
properties:
items:
items:
$ref: '#/definitions/subagent.Subagent'
type: array
type: object
subagent.SkillsResponse:
properties:
skills:
items:
type: string
type: array
type: object
subagent.Subagent:
properties:
bot_id:
type: string
created_at:
type: string
deleted:
type: boolean
deleted_at:
type: string
description:
type: string
id:
type: string
messages:
items:
additionalProperties: true
type: object
type: array
metadata:
additionalProperties: true
type: object
name:
type: string
skills:
items:
type: string
type: array
updated_at:
type: string
type: object
subagent.UpdateContextRequest:
properties:
messages:
items:
additionalProperties: true
type: object
type: array
type: object
subagent.UpdateRequest:
properties:
description:
type: string
metadata:
additionalProperties: true
type: object
name:
type: string
type: object
subagent.UpdateSkillsRequest:
properties:
skills:
items:
type: string
type: array
type: object
users.CreateUserRequest:
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
type: object
users.ListUsersResponse:
properties:
items:
items:
$ref: '#/definitions/users.User'
type: array
type: object
users.ResetPasswordRequest:
properties:
new_password:
type: string
type: object
users.UpdatePasswordRequest:
properties:
current_password:
type: string
new_password:
type: string
type: object
users.UpdateProfileRequest:
properties:
avatar_url:
type: string
display_name:
type: string
type: object
users.UpdateUserRequest:
properties:
avatar_url:
type: string
display_name:
type: string
is_active:
type: boolean
role:
type: string
type: object
users.User:
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
type: object
info:
contact: {}
title: Memoh API
version: 1.0.0
paths:
/auth/login:
post:
description: Validate user credentials and issue a JWT
parameters:
- description: Login request
in: body
name: payload
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'
summary: Login
tags:
- auth
/bots:
get:
description: List bots accessible to current user (admin can specify owner_id)
parameters:
- description: Owner user ID (admin only)
in: query
name: owner_id
type: string
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'
summary: List bots
tags:
- bots
post:
description: Create a bot user owned by current user (or admin-specified owner)
parameters:
- description: Bot payload
in: body
name: payload
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'
summary: Create bot user
tags:
- bots
/bots/{bot_id}/chat:
post:
consumes:
- application/json
description: Send a chat message and get a response. The system will automatically
select an appropriate chat model from the database.
parameters:
- description: Chat request
in: body
name: request
required: true
schema:
$ref: '#/definitions/chat.ChatRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/chat.ChatResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Chat with AI
tags:
- chat
/bots/{bot_id}/chat/stream:
post:
consumes:
- application/json
description: Send a chat message and get a streaming response. The system will
automatically select an appropriate chat model from the database.
parameters:
- description: Chat request
in: body
name: request
required: true
schema:
$ref: '#/definitions/chat.ChatRequest'
produces:
- text/event-stream
responses:
"200":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Stream chat with AI
tags:
- chat
/bots/{bot_id}/history:
delete:
description: Delete all history records for current user
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete all history records
tags:
- history
get:
description: List history records for current user
parameters:
- description: Limit
in: query
name: limit
type: integer
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history.ListResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List history records
tags:
- history
post:
description: Create a history record for current user
parameters:
- description: History payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/history.CreateRequest'
responses:
"201":
description: Created
schema:
$ref: '#/definitions/history.Record'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Create history record
tags:
- history
/bots/{bot_id}/history/{id}:
delete:
description: Delete a history record by ID (must belong to current user)
parameters:
- description: History ID
in: path
name: id
required: true
type: string
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'
summary: Delete history record
tags:
- history
get:
description: Get a history record by ID (must belong to current user)
parameters:
- description: History ID
in: path
name: id
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history.Record'
"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'
summary: Get history record
tags:
- history
/bots/{bot_id}/memory/add:
post:
description: 'Add memory for a user via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Add request
in: body
name: payload
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'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Add memory
tags:
- memory
/bots/{bot_id}/memory/embed:
post:
description: 'Embed text or multimodal input and upsert into memory store. Auth:
Bearer JWT determines user_id (sub or user_id).'
parameters:
- description: Embed upsert request
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.memoryEmbedUpsertPayload'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.EmbedUpsertResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Embed and upsert memory
tags:
- memory
/bots/{bot_id}/memory/memories:
delete:
description: 'Delete all memories for a user via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Delete all request
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.memoryDeleteAllPayload'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.DeleteResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete memories
tags:
- memory
get:
description: 'List memories for a user via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Run ID
in: query
name: run_id
type: string
- description: Limit
in: query
name: limit
type: integer
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.SearchResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List memories
tags:
- memory
/bots/{bot_id}/memory/memories/{memoryId}:
delete:
description: 'Delete a memory by ID via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Memory ID
in: path
name: memoryId
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.DeleteResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete memory
tags:
- memory
get:
description: 'Get a memory by ID via memory. Auth: Bearer JWT determines user_id
(sub or user_id).'
parameters:
- description: Memory ID
in: path
name: memoryId
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.MemoryItem'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Get memory
tags:
- memory
/bots/{bot_id}/memory/search:
post:
description: 'Search memories for a user via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Search request
in: body
name: payload
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'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Search memories
tags:
- memory
/bots/{bot_id}/memory/update:
post:
description: 'Update a memory by ID via memory. Auth: Bearer JWT determines
user_id (sub or user_id).'
parameters:
- description: Update request
in: body
name: payload
required: true
schema:
$ref: '#/definitions/memory.UpdateRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/memory.MemoryItem'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Update memory
tags:
- memory
/bots/{bot_id}/schedule:
get:
description: List schedules for current user
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'
summary: List schedules
tags:
- schedule
post:
description: Create a schedule for current user
parameters:
- description: Schedule payload
in: body
name: payload
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'
summary: Create schedule
tags:
- schedule
/bots/{bot_id}/schedule/{id}:
delete:
description: Delete a schedule by ID
parameters:
- description: Schedule ID
in: path
name: id
required: true
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete schedule
tags:
- schedule
get:
description: Get a schedule by ID
parameters:
- description: Schedule ID
in: path
name: id
required: true
type: string
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'
summary: Get schedule
tags:
- schedule
put:
description: Update a schedule by ID
parameters:
- description: Schedule ID
in: path
name: id
required: true
type: string
- description: Schedule payload
in: body
name: payload
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'
summary: Update schedule
tags:
- schedule
/bots/{bot_id}/settings:
delete:
description: Remove agent settings for current user
responses:
"204":
description: No Content
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete user settings
tags:
- settings
get:
description: Get agent settings for current user
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'
summary: Get user settings
tags:
- settings
post:
description: Update or create agent settings for current user
parameters:
- description: Settings payload
in: body
name: payload
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'
summary: Update user settings
tags:
- settings
put:
description: Update or create agent settings for current user
parameters:
- description: Settings payload
in: body
name: payload
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'
summary: Update user settings
tags:
- settings
/bots/{bot_id}/subagents:
get:
description: List subagents for current user
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'
summary: List subagents
tags:
- subagent
post:
description: Create a subagent for current user
parameters:
- description: Subagent payload
in: body
name: payload
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'
summary: Create subagent
tags:
- subagent
/bots/{bot_id}/subagents/{id}:
delete:
description: Delete a subagent by ID
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
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'
summary: Delete subagent
tags:
- subagent
get:
description: Get a subagent by ID
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
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'
summary: Get subagent
tags:
- subagent
put:
description: Update a subagent by ID
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
- description: Subagent payload
in: body
name: payload
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'
summary: Update subagent
tags:
- subagent
/bots/{bot_id}/subagents/{id}/context:
get:
description: Get a subagent's message context
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
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'
summary: Get subagent context
tags:
- subagent
put:
description: Update a subagent's message context
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
- description: Context payload
in: body
name: payload
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'
summary: Update subagent context
tags:
- subagent
/bots/{bot_id}/subagents/{id}/skills:
get:
description: Get a subagent's skills
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
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'
summary: Get subagent skills
tags:
- subagent
post:
description: Add skills to a subagent
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
- description: Skills payload
in: body
name: payload
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'
summary: Add subagent skills
tags:
- subagent
put:
description: Replace a subagent's skills
parameters:
- description: Subagent ID
in: path
name: id
required: true
type: string
- description: Skills payload
in: body
name: payload
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'
summary: Update subagent skills
tags:
- subagent
/bots/{id}:
delete:
description: Delete a bot user (owner/admin only)
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
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'
summary: Delete bot
tags:
- bots
get:
description: Get a bot by ID (owner/admin only)
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
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'
summary: Get bot details
tags:
- bots
put:
description: Update bot profile (owner/admin only)
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Bot update payload
in: body
name: payload
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'
summary: Update bot details
tags:
- bots
/bots/{id}/channel/{platform}:
get:
description: Get bot channel configuration
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Channel platform
in: path
name: platform
required: true
type: string
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'
summary: Get bot channel config
tags:
- bots
put:
description: Update bot channel configuration
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Channel platform
in: path
name: platform
required: true
type: string
- description: Channel config payload
in: body
name: payload
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'
summary: Update bot channel config
tags:
- bots
/bots/{id}/channel/{platform}/send:
post:
description: Send a message using bot channel configuration
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Channel platform
in: path
name: platform
required: true
type: string
- description: Send payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/channel.SendRequest'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"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'
summary: Send message via bot channel
tags:
- bots
/bots/{id}/channel/{platform}/send_session:
post:
description: Send a message using a session-scoped token (reply only)
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Channel platform
in: path
name: platform
required: true
type: string
- description: Send payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/channel.SendRequest'
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"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'
summary: Send message via bot channel session token
tags:
- bots
/bots/{id}/members:
get:
description: List members for a bot
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
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'
summary: List bot members
tags:
- bots
put:
description: Add or update bot member role
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Member payload
in: body
name: payload
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'
summary: Upsert bot member
tags:
- bots
/bots/{id}/members/{user_id}:
delete:
description: Remove a member from a bot
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: User ID
in: path
name: user_id
required: true
type: string
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'
summary: Delete bot member
tags:
- bots
/bots/{id}/owner:
put:
description: Transfer bot ownership to another human user
parameters:
- description: Bot ID
in: path
name: id
required: true
type: string
- description: Transfer payload
in: body
name: payload
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'
summary: Transfer bot owner (admin only)
tags:
- bots
/container:
post:
parameters:
- description: Create container payload
in: body
name: payload
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'
summary: Create and start MCP container
tags:
- containerd
/container/{id}:
delete:
parameters:
- description: Container ID
in: path
name: id
required: true
type: string
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'
summary: Delete MCP container
tags:
- containerd
/container/fs/{id}:
post:
description: |-
Forwards MCP JSON-RPC requests to the MCP server inside the container.
Required:
- container task is running
- container has data mount (default /data) bound to <data_root>/users/<user_id>
- container image contains the "mcp" binary
Auth: Bearer JWT is used to determine user_id (sub or user_id).
Paths must be relative (no leading slash) and must not contain "..".
Example: tools/list
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
Example: tools/call (fs.read)
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"fs.read","arguments":{"path":"notes.txt"}}}
parameters:
- description: Bearer <token>
in: header
name: Authorization
required: true
type: string
- description: Container ID
in: path
name: id
required: true
type: string
- description: JSON-RPC request
in: body
name: payload
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'
summary: MCP filesystem tools (JSON-RPC)
tags:
- containerd
/container/list:
get:
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.ListContainersResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List containers
tags:
- containerd
/container/skills:
delete:
parameters:
- description: Delete skills payload
in: body
name: payload
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'
summary: Delete skills from container
tags:
- containerd
get:
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'
summary: List skills from container
tags:
- containerd
post:
parameters:
- description: Skills payload
in: body
name: payload
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'
summary: Upload skills into container
tags:
- containerd
/container/snapshots:
get:
parameters:
- description: Snapshotter name
in: query
name: snapshotter
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.ListSnapshotsResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List snapshots
tags:
- containerd
post:
parameters:
- description: Create snapshot payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.CreateSnapshotRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.CreateSnapshotResponse'
"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'
summary: Create container snapshot
tags:
- containerd
/embeddings:
post:
description: Create text or multimodal embeddings
parameters:
- description: Embeddings request
in: body
name: payload
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'
summary: Create embeddings
tags:
- embeddings
/models:
get:
description: Get a list of all configured models, optionally filtered by type
or client type
parameters:
- description: Model type (chat, embedding)
in: query
name: type
type: string
- description: Client type (openai, anthropic, google)
in: query
name: client_type
type: string
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/models.GetResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List all models
tags:
- models
post:
description: Create a new model configuration
parameters:
- description: Model configuration
in: body
name: payload
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'
summary: Create a new model
tags:
- models
/models/{id}:
delete:
description: Delete a model configuration by its internal UUID
parameters:
- description: Model internal ID (UUID)
in: path
name: id
required: true
type: string
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'
summary: Delete model by internal ID
tags:
- models
get:
description: Get a model configuration by its internal UUID
parameters:
- description: Model internal ID (UUID)
in: path
name: id
required: true
type: string
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'
summary: Get model by internal ID
tags:
- models
put:
description: Update a model configuration by its internal UUID
parameters:
- description: Model internal ID (UUID)
in: path
name: id
required: true
type: string
- description: Updated model configuration
in: body
name: payload
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'
summary: Update model by internal ID
tags:
- models
/models/count:
get:
description: Get the total count of models, optionally filtered by type
parameters:
- description: Model type (chat, embedding)
in: query
name: type
type: string
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'
summary: Get model count
tags:
- models
/models/enable:
post:
description: Update the current user's settings to use the selected model
parameters:
- description: Enable model payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.EnableModelRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/settings.Settings'
"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'
summary: Enable model for chat/memory/embedding
tags:
- models
/models/model/{modelId}:
delete:
description: Delete a model configuration by its model_id field (e.g., gpt-4)
parameters:
- description: Model ID (e.g., gpt-4)
in: path
name: modelId
required: true
type: string
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'
summary: Delete model by model ID
tags:
- models
get:
description: Get a model configuration by its model_id field (e.g., gpt-4)
parameters:
- description: Model ID (e.g., gpt-4)
in: path
name: modelId
required: true
type: string
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'
summary: Get model by model ID
tags:
- models
put:
description: Update a model configuration by its model_id field (e.g., gpt-4)
parameters:
- description: Model ID (e.g., gpt-4)
in: path
name: modelId
required: true
type: string
- description: Updated model configuration
in: body
name: payload
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'
summary: Update model by model ID
tags:
- models
/providers:
get:
consumes:
- application/json
description: Get a list of all configured LLM providers, optionally filtered
by client type
parameters:
- description: Client type filter (openai, anthropic, google, ollama)
in: query
name: client_type
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/providers.GetResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List all LLM providers
tags:
- providers
post:
consumes:
- application/json
description: Create a new LLM provider configuration
parameters:
- description: Provider configuration
in: body
name: request
required: true
schema:
$ref: '#/definitions/providers.CreateRequest'
produces:
- application/json
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'
summary: Create a new LLM provider
tags:
- providers
/providers/{id}:
delete:
consumes:
- application/json
description: Delete a provider configuration
parameters:
- description: Provider ID (UUID)
in: path
name: id
required: true
type: string
produces:
- application/json
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'
summary: Delete provider
tags:
- providers
get:
consumes:
- application/json
description: Get a provider configuration by its ID
parameters:
- description: Provider ID (UUID)
in: path
name: id
required: true
type: string
produces:
- application/json
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'
summary: Get provider by ID
tags:
- providers
put:
consumes:
- application/json
description: Update an existing provider configuration
parameters:
- description: Provider ID (UUID)
in: path
name: id
required: true
type: string
- description: Updated provider configuration
in: body
name: request
required: true
schema:
$ref: '#/definitions/providers.UpdateRequest'
produces:
- application/json
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'
summary: Update provider
tags:
- providers
/providers/{id}/models:
get:
description: Get models for a provider by id, optionally filtered by type
parameters:
- description: Provider ID (UUID)
in: path
name: id
required: true
type: string
- description: Model type (chat, embedding)
in: query
name: type
type: string
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/models.GetResponse'
type: array
"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'
summary: List provider models
tags:
- providers
/providers/count:
get:
consumes:
- application/json
description: Get the total count of providers, optionally filtered by client
type
parameters:
- description: Client type filter (openai, anthropic, google, ollama)
in: query
name: client_type
type: string
produces:
- application/json
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'
summary: Count providers
tags:
- providers
/providers/name/{name}:
get:
consumes:
- application/json
description: Get a provider configuration by its name
parameters:
- description: Provider name
in: path
name: name
required: true
type: string
produces:
- application/json
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'
summary: Get provider by name
tags:
- providers
/users:
get:
description: List users
responses:
"200":
description: OK
schema:
$ref: '#/definitions/users.ListUsersResponse'
"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'
summary: List users (admin only)
tags:
- users
post:
description: Create a new human user account
parameters:
- description: User payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/users.CreateUserRequest'
responses:
"201":
description: Created
schema:
$ref: '#/definitions/users.User'
"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'
summary: Create human user (admin only)
tags:
- users
/users/{id}:
get:
description: Get user details (self or admin only)
parameters:
- description: User ID
in: path
name: id
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/users.User'
"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'
summary: Get user by ID
tags:
- users
put:
description: Update user profile and status
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: User update payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/users.UpdateUserRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/users.User'
"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'
summary: Update user (admin only)
tags:
- users
/users/{id}/password:
put:
description: Reset a user password
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: Password payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/users.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'
summary: Reset user password (admin only)
tags:
- users
/users/me:
get:
description: Get current user profile
responses:
"200":
description: OK
schema:
$ref: '#/definitions/users.User'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Get current user
tags:
- users
put:
description: Update current user display name or avatar
parameters:
- description: Profile payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/users.UpdateProfileRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/users.User'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Update current user profile
tags:
- users
/users/me/channels/{platform}:
get:
description: Get channel binding configuration for current user
parameters:
- description: Channel platform
in: path
name: platform
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/channel.ChannelUserBinding'
"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'
summary: Get channel user config
tags:
- channel
put:
description: Update channel binding configuration for current user
parameters:
- description: Channel platform
in: path
name: platform
required: true
type: string
- description: Channel user config payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/channel.UpsertUserConfigRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/channel.ChannelUserBinding'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Update channel user config
tags:
- channel
/users/me/password:
put:
description: Update current user password with current password check
parameters:
- description: Password payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/users.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'
summary: Update current user password
tags:
- users
swagger: "2.0"