Authentification
Rendra utilise des clés API pour l'authentification. Chaque requête vers un endpoint protégé doit inclure un jeton Bearer valide.
Obtenir une clé API
API keys are created when you register an account. Send a POST request to /api/v1/users with your email address:
curl -X POST https://rendra.alphabros.eu/api/v1/users \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'
Response:
{
"id": "usr_abc123",
"email": "you@example.com",
"api_key": "rnd_live_xxxxxxxxxxxxxxxxxxxx",
"plan": "free"
}
api_key is shown only once at creation time. Store it securely — you cannot retrieve it again. If you lose it, you will need to contact support to rotate it.
Utiliser votre clé API
Pass your API key as a Bearer token in the Authorization header on every request:
Authorization: Bearer YOUR_API_KEY
Example — curl
curl -X POST https://rendra.alphabros.eu/api/v1/generate \
-H "Authorization: Bearer rnd_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "A clean product launch banner", "width": 1200, "height": 630}'
Example — JavaScript (fetch)
const response = await fetch('https://rendra.alphabros.eu/api/v1/generate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENDRA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: 'A clean product launch banner',
width: 1200,
height: 630,
}),
});
Erreurs d'authentification
| Statut | Code | Description |
|---|---|---|
401 |
Unauthorized |
Missing or malformed Authorization header. |
403 |
Forbidden |
API key is invalid or has been revoked. |
429 |
Too Many Requests |
You have exceeded your plan's rate limit. See Facturation et utilisation. |
Bonnes pratiques de sécurité
N'exposez jamais votre clé API côté client
Appelez toujours l'API Rendra depuis votre serveur ou une fonction serverless. N'intégrez jamais votre clé dans du JavaScript de navigateur ni dans des binaires d'application mobile.
Utilisez des variables d'environnement
Store your key in an environment variable (RENDRA_API_KEY) and load it at runtime. Never hardcode it in source files or commit it to version control.
Renouvelez les clés en cas de compromission
If you suspect your key has been leaked, contact support@alphabros.eu immediately to have it rotated.