跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.llmgenerator.com/llms.txt

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

POST /api-keys//regenerate

重新生成 API Key:保留名称、描述、权限等元数据,生成新的密钥串;旧密钥立即失效。
新密钥同样仅展示一次;旧密钥即刻不可用。
不能使用当前请求正在使用的 API Key 来重新生成自身。

路径参数

keyId
string
必填
要重新生成的 API Key ID。

响应

success
boolean
是否成功。
message
string
状态说明。
apiKey
object
重新生成后的详情。
warning
string
提示旧密钥已失效。
curl -X POST https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456/regenerate \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "message": "API key regenerated successfully",
  "apiKey": {
    "id": "llm_1706123456_abc123def456",
    "name": "Production Key",
    "key": "llm_1706456789_newvalue567xyz",
    "regeneratedAt": "2026-01-27T10:00:00.000Z"
  },
  "warning": "This is the only time the new API key will be shown. Please save it securely. The old key is now invalid."
}