API-AI-014:用户 DeepSeek Key 测试连接 API #175

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

目标

用户填写 DeepSeek Key 后,可以测试该 key 是否可用。

接口建议

POST /ai/model-credentials/{id}/test

流程

  1. 校验 credential 属于当前用户。
  2. 解密 key。
  3. 发起一次最小 DeepSeek 测试请求。
  4. 记录 lastTestedAt。
  5. 成功则 status = active。
  6. 失败则 status = invalid,并记录 lastErrorCode。

安全要求

  1. 测试请求不得把用户学习内容发送给 DeepSeek。
  2. 测试 prompt 必须是固定最小内容。
  3. 不记录明文 key。

验收标准

  1. 有效 key 返回 success。
  2. 无效 key 返回明确 errorCode。
  3. 测试结果写入 credential 状态。
  4. 不允许测试其他用户 key。
  5. 不发送用户资料内容。
  6. 提供 mock DeepSeek 测试。
## 目标 用户填写 DeepSeek Key 后,可以测试该 key 是否可用。 ## 接口建议 ``` POST /ai/model-credentials/{id}/test ``` ## 流程 1. 校验 credential 属于当前用户。 2. 解密 key。 3. 发起一次最小 DeepSeek 测试请求。 4. 记录 lastTestedAt。 5. 成功则 status = active。 6. 失败则 status = invalid,并记录 lastErrorCode。 ## 安全要求 1. 测试请求不得把用户学习内容发送给 DeepSeek。 2. 测试 prompt 必须是固定最小内容。 3. 不记录明文 key。 ## 验收标准 1. 有效 key 返回 success。 2. 无效 key 返回明确 errorCode。 3. 测试结果写入 credential 状态。 4. 不允许测试其他用户 key。 5. 不发送用户资料内容。 6. 提供 mock DeepSeek 测试。
wangdl added this to the M-API-AI-RUNTIME:API AI Runtime 调度与落库 milestone 2026-06-10 21:03:22 +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#175
No description provided.