API-AI-013:用户 DeepSeek Key 添加 / 替换 / 删除 API #174

Open
opened 2026-06-10 21:03:20 +08:00 by wangdl · 0 comments
Owner

目标

支持用户添加、替换、删除自己的 DeepSeek Key。

接口建议

GET    /ai/model-credentials
POST   /ai/model-credentials
PUT    /ai/model-credentials/{id}
DELETE /ai/model-credentials/{id}

请求字段

  • provider
  • apiKey
  • keyAlias

响应字段

  • id
  • provider
  • keyAlias
  • maskedKey
  • status
  • lastTestedAt
  • lastUsedAt
  • createdAt
  • updatedAt

安全要求

  1. apiKey 只在创建 / 替换时传入。
  2. apiKey 不返回。
  3. apiKey 加密后存储。
  4. 删除为软删除。
  5. Admin 不可查看明文。

验收标准

  1. 用户可添加 DeepSeek key。
  2. 用户可替换自己的 key。
  3. 用户可删除自己的 key。
  4. 查询接口只返回 maskedKey。
  5. 日志中不出现明文 key。
  6. 不允许操作其他用户的 key。
  7. keyHash 可用于重复检测。
  8. 提供安全测试。
## 目标 支持用户添加、替换、删除自己的 DeepSeek Key。 ## 接口建议 ``` GET /ai/model-credentials POST /ai/model-credentials PUT /ai/model-credentials/{id} DELETE /ai/model-credentials/{id} ``` ## 请求字段 - provider - apiKey - keyAlias ## 响应字段 - id - provider - keyAlias - maskedKey - status - lastTestedAt - lastUsedAt - createdAt - updatedAt ## 安全要求 1. apiKey 只在创建 / 替换时传入。 2. apiKey 不返回。 3. apiKey 加密后存储。 4. 删除为软删除。 5. Admin 不可查看明文。 ## 验收标准 1. 用户可添加 DeepSeek key。 2. 用户可替换自己的 key。 3. 用户可删除自己的 key。 4. 查询接口只返回 maskedKey。 5. 日志中不出现明文 key。 6. 不允许操作其他用户的 key。 7. keyHash 可用于重复检测。 8. 提供安全测试。
wangdl added this to the M-API-AI-RUNTIME:API AI Runtime 调度与落库 milestone 2026-06-10 21:03:20 +08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/api-server#174
No description provided.