Skip to main content

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.

Overview

Use this endpoint to update the name, usage limit, allowed models, expiry, or status of an existing user API key.

Request Body

At least one field must be provided.
FieldTypeDefault / LimitsNotes
statusenum-active, inactive, suspended, revoked
namestringlength 1-50Updated display name
limitAmountnumber | nullmin 0, input max 1000000null = unlimited, 0 = zero quota. Positive values are normalized to a stored cap that cannot exceed 100000 USD equivalent.
limitCurrencyenumdefault USDUSD only. Sending CNY returns 400 currency_retired.
modelsstring[]-Updated logical model allowlist
expiresAtstring | nullRFC3339 datetimenull clears the expiry

Notes

  • Monetary fields are USD-only. CNY inputs are retired and return 400 currency_retired.
  • Hard delete is intentionally not supported in Management API v1.
  • revoked is terminal for ordinary operational use; create a new key instead of expecting a future un-revoke flow.

Example

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
  }'

Request / Response

Use the interactive OpenAPI panel above for the exact schema and response fields.