POST /api-keys//regenerate
重新生成 API Key:保留名称、描述、权限等元数据,生成新的密钥串;旧密钥立即失效。不能使用当前请求正在使用的 API Key 来重新生成自身。
路径参数
string
必填
要重新生成的 API Key ID。
响应
boolean
是否成功。
string
状态说明。
object
重新生成后的详情。
string
提示旧密钥已失效。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456/regenerate \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456/regenerate',
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
// Save data.apiKey.key securely!
{
"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."
}
{
"message": "Cannot regenerate the API key currently being used"
}
{
"message": "API key not found"
}
重新生成 API Key 密钥串。
curl -X POST https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456/regenerate \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456/regenerate',
{
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const data = await response.json();
// Save data.apiKey.key securely!
{
"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."
}
{
"message": "Cannot regenerate the API key currently being used"
}
{
"message": "API key not found"
}
此页面对您有帮助吗?