curl -X POST https://api.llmgenerator.com/api/v1/api-keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"description": "For the main application"
}'
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Production API Key',
description: 'For the main application'
})
}
);
const data = await response.json();
// Save data.apiKey.key securely!
{
"success": true,
"message": "API key created successfully",
"apiKey": {
"id": "llm_1706345678_newkey123abc",
"name": "Production API Key",
"description": "For the main application",
"key": "llm_1706345678_newkey123abc",
"permissions": [],
"expiresAt": null,
"createdAt": "2026-01-27T10:00:00.000Z",
"isActive": true
},
"warning": "This is the only time the full API key will be shown. Please save it securely."
}
{
"message": "Validation error: Name is required"
}
Gestión de claves API
Crear clave API
Este extremo crea una nueva clave API.
curl -X POST https://api.llmgenerator.com/api/v1/api-keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"description": "For the main application"
}'
const response = await fetch(
'https://api.llmgenerator.com/api/v1/api-keys',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Production API Key',
description: 'For the main application'
})
}
);
const data = await response.json();
// Save data.apiKey.key securely!
{
"success": true,
"message": "API key created successfully",
"apiKey": {
"id": "llm_1706345678_newkey123abc",
"name": "Production API Key",
"description": "For the main application",
"key": "llm_1706345678_newkey123abc",
"permissions": [],
"expiresAt": null,
"createdAt": "2026-01-27T10:00:00.000Z",
"isActive": true
},
"warning": "This is the only time the full API key will be shown. Please save it securely."
}
{
"message": "Validation error: Name is required"
}
¿Esta página le ayudó?
⌘I