Skip to main content

模型管理

模型管理接口用于创建和管理AI模型。所有接口都需要开发者权限。

获取模型列表

/dev/model/list
获取模型列表。

请求参数

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

获取模型详情

/dev/model/:id
获取指定模型的详细信息。

请求参数

参数名类型必选说明
idstring模型ID
GET /dev/model/model_123
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

创建模型

/dev/model
创建新的模型。

请求参数

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

{
  "name": "新模型",
  "type": "language",
  "description": "这是一个新模型",
  "config": {
    "version": "1.0",
    "parameters": "1B"
  }
}

更新模型

/dev/model/:id
更新指定模型的信息。

请求参数

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

{
  "name": "更新后的模型",
  "description": "这是更新后的模型描述"
}

删除模型

/dev/model/:id
删除指定的模型。

请求参数

参数名类型必选说明
idstring模型ID
DELETE /dev/model/model_124
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

错误码说明

错误码说明

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