跳轉到主要內容

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.

概覽

這個 endpoint 可更新既有 API Key 的名稱、額度、模型白名單、過期時間或狀態。

請求主體

PATCH 請求至少需要提供一個欄位。
欄位型別預設值 / 限制說明
statusenum-activeinactivesuspendedrevoked
namestring長度 1-50更新後的顯示名稱
limitAmountnumber | null最小 0,輸入上限 1000000null = 不限額,0 = 零額度,正數會被規範化為一個儲存上限,且不能超過 100000 USD 等值
limitCurrency列舉預設 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 面板。