如何保管 API Key?
- 不要把
sk-写入公开仓库、前端打包产物或截图 - 使用环境变量 / 密钥管理服务
- 泄露后立即在控制台轮换/作废
- 开发、预发、生产尽量使用不同 Key,便于撤销
两套凭证
不要用
sk- 去调发布接口,也不要用用户 token 冒充网关 Key(除非产品明确支持)。
最小权限习惯
- 只给自动化机器人所需模型的分组/权限
- 日志中不要打印完整 Key
- 分享「示例 curl」时使用占位符
<token>
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API Key 与 access token 使用注意
sk- 写入公开仓库、前端打包产物或截图| 凭证 | 用途 |
|---|---|
sk- API Key | 网关推理、社交数据读等 |
用户 access token + New-Api-User | 设备码登录后的用户 API、社媒发布 |
sk- 去调发布接口,也不要用用户 token 冒充网关 Key(除非产品明确支持)。
<token>