~/Documentation
Documentación

Autenticación

Todas las solicitudes de API requieren autenticación usando un token Bearer.

Usando tu Clave API

Incluye tu clave API en el encabezado Authorization de cada solicitud:

Authorization: Bearer ${RENDERFUL_API_KEY}

Developer API keys typically start with sk_ (legacy keys may start with vega_). Agent keys start with rf_.

Solicitud de Ejemplo

curl -X POST https://api.renderful.ai/api/v1/generations \
  -H "Authorization: Bearer ${RENDERFUL_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"type":"text-to-image","model":"flux-dev","prompt":"A sunset"}'

Mejores Prácticas de Seguridad

  • Nunca expongas tu clave API en código del lado del cliente
  • Usa variables de entorno para almacenar tu clave
  • Rota las claves periódicamente
  • Usa diferentes claves para desarrollo y producción

Balance endpoints by key type

Use the balance endpoint that matches the key prefix you are authenticating with.

Key TypePrefixBalance Endpoint
Developer API keysk_ / vega_GET /api/v1/account/balance
Agent API keyrf_GET /api/v1/agents/balance

Query developer balance

curl -X GET https://api.renderful.ai/api/v1/account/balance \
  -H "Authorization: Bearer sk_your_api_key"

Formato de Clave API

Las claves API de Renderful siguen un formato específico para fácil identificación:

PrefijoDescripción
sk_Developer API key for dashboard-created server-side integrations
vega_Legacy developer API key format still accepted for existing integrations
rf_Agent API key returned by POST /api/v1/agents/register