Skip to content

管理员接口

管理员接口前缀为 /api,需要:

text
Authorization: Bearer <jwt>

并且当前用户必须是管理员。

系统设置

方法路径参数请求体返回值
GET/api/settings系统设置对象。
PUT/api/settings系统设置字段。更新后的系统设置对象或成功响应。

设置字段包含站点名称、注册开关、OIDC、SMTP、支付、主题、状态页、公开价格、聊天页面模式等。字段以 SystemAPI 当前结构为准。

状态监控

方法路径参数请求体返回值
GET/api/status-monitors状态监控列表。
POST/api/status-monitors监控名称、类型、目标、启用状态等。新建的状态监控。
PUT/api/status-monitors/:idPath: id监控名称、类型、目标、启用状态等。更新后的状态监控。
DELETE/api/status-monitors/:idPath: id删除成功响应。
POST/api/status-monitors/:id/checkPath: id本次检查结果。

公告

方法路径参数请求体返回值
GET/api/announcements公告列表。
POST/api/announcementstitlecontentenabledsort_order新建公告。
PUT/api/announcements/:idPath: idtitlecontentenabledsort_order更新公告。
DELETE/api/announcements/:idPath: id删除成功响应。

上级渠道

方法路径参数请求体返回值
GET/api/channels上级渠道列表。
POST/api/channels渠道名称、类型、Base URL、API Key、权重、优先级、启用状态、用户渠道等。新建渠道。
PUT/api/channels/:idPath: id渠道字段。更新后的渠道。
DELETE/api/channels/:idPath: id删除成功响应。
PUT/api/channels/:id/group-multipliersPath: id分组倍率配置。更新成功响应。
GET/api/channels/:id/modelsPath: id渠道模型配置列表。
POST/api/channels/:id/modelsPath: id模型配置字段。新建渠道模型配置。
POST/api/channels/sync可选渠道 ID 列表。同步结果。

渠道类型包括 openairesponsesopenai-videoklingclaudegemini 等。

全局模型

方法路径参数请求体返回值
GET/api/models全局模型列表。
POST/api/models模型名称、供应商、价格、限流、计费类型、视频计费配置等。新建模型。
PUT/api/models/:idPath: id模型字段。更新后的模型。
DELETE/api/models/:idPath: id删除成功响应。
POST/api/models/sync同步选项。同步结果。
POST/api/models/sync/preview渠道和同步格式。预览结果。
POST/api/models/sync/preview/browser浏览器获取的原始内容和来源。预览结果。
POST/api/models/sync/apply预览项。应用结果。
POST/api/models/prices/sync/preview渠道和价格同步格式。价格预览结果。
POST/api/models/prices/sync/preview/browser浏览器获取的价格原始内容和来源。价格预览结果。
POST/api/models/prices/sync/apply价格预览项。应用结果。

渠道模型配置

方法路径参数请求体返回值
PUT/api/channel-models/:idPath: id渠道模型字段,如上游模型名、价格覆盖、启用状态。更新后的渠道模型配置。
DELETE/api/channel-models/:idPath: id删除成功响应。
PUT/api/channel-models/:id/group-multipliersPath: id分组倍率配置。更新成功响应。

用户渠道

方法路径参数请求体返回值
GET/api/user-channels用户渠道列表。
POST/api/user-channels名称、路由算法、启用状态。新建用户渠道。
PUT/api/user-channels/:idPath: id用户渠道字段。更新后的用户渠道。
DELETE/api/user-channels/:idPath: id删除成功响应。

分组

方法路径参数请求体返回值
GET/api/groups分组列表。
POST/api/groups分组名称、倍率、默认标记等。新建分组。
PUT/api/groups/:idPath: id分组字段。更新后的分组。
DELETE/api/groups/:idPath: id删除成功响应。

用户

方法路径参数请求体返回值
GET/api/usersQuery: 分页、搜索等。用户列表或分页对象。
PUT/api/users/:idPath: id用户字段,如余额、分组、管理员状态、启用状态。更新后的用户。
DELETE/api/users/:idPath: id删除成功响应。
GET/api/referral-commissionsQuery: 分页、时间范围。邀请返佣记录。

统计

方法路径参数请求体返回值
GET/api/logsQuery: 分页、用户、模型、时间范围等。用量日志或分页对象。
GET/api/stats管理员仪表盘统计。
GET/api/channel-usageQuery: 时间范围。用户渠道和上级渠道用量统计。

基于 MIT 协议发布(社区版)