Authentication
Sync 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.
Sample Request
You can run the following sample request to generate a lipsynced video rightaway. Be sure to replace <apiKey> with your actual API key.
SDK Authentication
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:
Python
You can also pass the key directly:
TypeScript
You can also pass the key directly:
API Key Security Best Practices
Your API key grants full access to the Sync API on your behalf. Treat it like a password.
- Never commit keys to source control. Add
.envto your.gitignoreand use a secrets manager or environment variables instead. - Use environment variables in production. Store
SYNC_API_KEYin your hosting platform’s secrets or environment config rather than hardcoding it. - Rotate keys regularly. Generate a new key from the API Keys page periodically, then revoke the old one.
- Use separate keys per environment. Create distinct keys for development, staging, and production so a compromised dev key does not affect production traffic.
- Restrict access. Only share your API key with team members and services that need it.
Error Handling
If a request is missing a valid API key, the Sync API returns a 401 Unauthorized response.
Common causes:
- Missing header — The
x-api-keyheader was not included in the request. - Invalid key — The key is misspelled, expired, or revoked.
- Wrong environment variable — The
SYNC_API_KEYenvironment variable is not set or points to the wrong key.
When you receive a 401, verify that:
- Your API key is copied correctly with no extra whitespace.
- The
x-api-keyheader (notAuthorization) is present in the request. - The key is still active on the API Keys page.
For a full list of error codes and resolution steps, see the Error Handling guide.

