跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

概览

该接口用于更新已有用户 API Key 的名称、额度、模型白名单、过期时间或状态。

请求体

PATCH 请求至少需要提供一个字段。
字段类型默认值 / 限制说明
statusenum-activeinactivesuspendedrevoked
namestring长度 1-50更新后的展示名称
limitAmountnumber | null最小 0,输入上限 1000000null = 不限额,0 = 零额度,正数会被规范化为一个存储上限,且不能超过 100000 USD 等值
limitCurrencyenum默认 USD仅支持 USD。发送 CNY 会返回 400 currency_retired
modelsstring[]-更新后的逻辑模型白名单
expiresAtstring | nullRFC3339 datetimenull 表示清除过期时间

说明

  • Management API v1 故意不支持硬删除。
  • revoked 更适合作为终态使用;如需恢复,通常建议新建一个 Key,而不是依赖后续“解封”流程。

示例

curl -X PATCH "https://api.lemondata.cc/v1/management/api-keys/key_abc123def456" \
  -H "Authorization: Bearer mt-your-management-token" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "inactive",
    "limitAmount": 0
  }'

请求 / 响应

精确 schema 和响应字段请使用上方的交互式 OpenAPI 面板。