Skip to content

获取 API Key

API Key 用于请求鉴权,需要放在 HTTP 请求头里。

http
Authorization: Bearer sk-你的密钥

注意事项

  • 不要把 API Key 写进前端代码。
  • 不要把 API Key 发到公开群、工单截图或日志里。
  • 如果怀疑泄露,立即删除旧 Key 并重新生成。

验证 Key

bash
curl https://code.ciyuanapi.xyz/v1/models \
  -H "Authorization: Bearer $API_KEY"