PUT /api-keys/
更新已有 API Key 的名称与描述等元数据。路径参数
string
必填
要更新的 API Key ID。
请求体
string
新名称(1–100 个字符)。
string
新描述(最多 500 个字符)。
array
新的权限列表。
响应
boolean
更新是否成功。
string
状态说明。
object
更新后的详情。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X PUT https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Production Key",
"description": "Updated description"
}'
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Production Key'
})
}
);
{
"success": true,
"message": "API key updated successfully",
"apiKey": {
"id": "llm_1706123456_abc123def456",
"name": "Updated Production Key",
"description": "Updated description",
"permissions": [],
"updatedAt": "2026-01-27T10:00:00.000Z"
}
}
{
"message": "API key not found"
}
更新 API Key 的元数据。
curl -X PUT https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Production Key",
"description": "Updated description"
}'
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys/llm_1706123456_abc123def456',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Production Key'
})
}
);
{
"success": true,
"message": "API key updated successfully",
"apiKey": {
"id": "llm_1706123456_abc123def456",
"name": "Updated Production Key",
"description": "Updated description",
"permissions": [],
"updatedAt": "2026-01-27T10:00:00.000Z"
}
}
{
"message": "API key not found"
}
此页面对您有帮助吗?