Rendra Docs / Autenticación

Autenticación

Rendra usa claves API para la autenticación. Cada solicitud a un endpoint protegido debe incluir un token Bearer válido.

Obtener una clave 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"
}
Important: Your 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.

Usar tu clave 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,
  }),
});

Errores de autenticación

Estado 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 Facturación y uso.

Mejores prácticas de seguridad

Nunca expongas tu clave API en el lado del cliente

Llama siempre a la API de Rendra desde tu servidor o una función serverless. Nunca incrustes tu clave en JavaScript del navegador ni en binarios de aplicaciones móviles.

Usa variables de entorno

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.

Rota las claves si se ven comprometidas

If you suspect your key has been leaked, contact support@alphabros.eu immediately to have it rotated.

Next step: Now that you're authenticated, explore the Referencia de la API or jump straight to the Guía del SDK.