Skip to main content

应用管理

应用管理接口用于创建和管理外脑应用。所有接口都需要开发者权限。

获取应用列表

/dev/app/list
获取应用列表。

请求参数

参数名类型必选说明
pageinteger页码,默认1
sizeinteger每页数量
GET /dev/app/list?page=1&size=10
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

获取应用详情

/dev/app/:id
获取指定应用的详细信息。

请求参数

参数名类型必选说明
idstring应用ID
GET /dev/app/app_123
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

创建应用

/dev/app
创建新的应用。

请求参数

参数名类型必选说明
namestring应用名称
descriptionstring应用描述
configobject应用配置
POST /dev/app
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "新应用",
  "description": "这是一个新应用",
  "config": {
    "type": "chat",
    "model": "gpt-4"
  }
}

更新应用

/dev/app/:id
更新指定应用的信息。

请求参数

参数名类型必选说明
idstring应用ID
namestring应用名称
descriptionstring应用描述
configobject应用配置
PUT /dev/app/app_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

{
  "name": "更新后的应用",
  "description": "这是更新后的应用描述"
}

删除应用

/dev/app/:id
删除指定的应用。

请求参数

参数名类型必选说明
idstring应用ID
DELETE /dev/app/app_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

错误码说明

错误码说明

错误码说明
400请求参数错误
401未授权或令牌无效
403权限不足(需要开发者权限)
404应用不存在
422请求参数验证失败
500服务器错误