Sync Labs uses API key authentication via the x-api-key header. Create an API key from the API Keys page, then include it in every request.
You can run the following sample request to generate a lipsynced video rightaway. Be sure to replace <apiKey> with your actual API key.
The official Python and TypeScript SDKs automatically read your API key from the SYNC_API_KEY environment variable. Set the variable once and the SDK handles lip sync API authentication for every request.
No additional configuration is needed. The SDK picks up the key at initialization:
You can also pass the key directly:
You can also pass the key directly:
Your API key grants full access to the Sync Labs API on your behalf. Treat it like a password.
.env to your .gitignore and use a secrets manager or environment variables instead.SYNC_API_KEY in your hosting platform’s secrets or environment config rather than hardcoding it.If a request is missing a valid API key, the Sync Labs API returns a 401 Unauthorized response.
Common causes:
x-api-key header was not included in the request.SYNC_API_KEY environment variable is not set or points to the wrong key.When you receive a 401, verify that:
x-api-key header (not Authorization) is present in the request.For a full list of error codes and resolution steps, see the Error Handling guide.