Authentication
Img2Vid API uses API keys for server-to-server access.
Recommended header
Authorization: Bearer sk_your_api_key
Alternative header
X-API-Key: sk_your_api_key
Authorization: Bearer is recommended for production integrations.
API key scope
API keys are accepted only by the public API routes:
GET /api/v1/media_modelsGET /api/v1/appsGET /api/v1/apps/[app]GET /api/v1/modelsPOST /api/v1/chat/completionsPOST /api/v1/messagesPOST /api/v1beta/models/[model]:generateContentPOST /api/v1beta/models/[model]:streamGenerateContentPOST /api/v1/filesPOST /api/v1/generationsGET /api/v1/generations/[id]POST /api/v1/apps/[app]/generationsGET /api/v1/apps/[app]/generations/[id]
They are not browser sessions and should not be used with internal application routes.
Security best practices
- Store API keys in server environment variables.
- Never expose API keys in client-side JavaScript.
- Use separate keys for development and production.
- Rotate keys if they may have been leaked.