I’m encountering a problem with my N8n setup that creates videos using the Veo 2 API provided by Google. My workflow executes correctly, and I am able to make API calls to generate videos from images without any issue. I even receive a status 200 response, and it’s clear that Google is processing the requests.
However, when I attempt to retrieve the final video file, I encounter a 403 error. This error indicates that the Generative Language API has not been used in a specific project ID that I don’t recognize. This project isn’t listed in my Google Cloud console at all.
I have two Google Cloud projects where I have enabled the Gemini API, and everything is functioning as expected in those cases. Yet, the URL for downloading the video seems to refer to a different project that I cannot find or access.
Here’s the error message I’m receiving:
{
"error": {
"code": 403,
"message": "Generative Language API has not been used in project ZZZZZZZZ before or it is disabled. You can enable it by following the provided console link, then try again.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "SERVICE_DISABLED",
"domain": "googleapis.com",
"metadata": {
"service": "generativelanguage.googleapis.com",
"consumer": "projects/ZZZZZZZZ"
}
}
]
}
}
Does anyone have insights into why the video URL references a project different from the one I used for the initial API request? How can I resolve this authentication problem?
This issue frequently arises with Google’s Veo 2 API due to the storage of videos under different project settings than those used for API requests. I have encountered similar situations with Google’s video tools. Ensure that the ‘Generative Language API’ is enabled for your Google Cloud project, as access to video files depends on this. Additionally, verify that your service account has the ‘Generative AI User’ role assigned. Lastly, double-check your authentication headers for the download request; they could differ from those used during video generation.
You’re encountering a 403 error when trying to download videos created using n8n with the Google Veo 2 API. The error message indicates that the Generative Language API isn’t enabled in a project ID (ZZZZZZZZ) that’s not listed in your Google Cloud console. This suggests a mismatch between the project used to generate the video and the one used for downloading it.
Understanding the “Why” (The Root Cause):
The Google Veo 2 API (and likely its underlying infrastructure) uses internal project routing for video storage and retrieval. This means that even though you successfully generated the video using your designated Google Cloud project, the download URL points to a different, internal Google project handling video storage. Your n8n workflow, while successfully authenticating for video generation, isn’t automatically inheriting the necessary authentication context for accessing the video in this separate internal project. This is a common problem with Google’s more complex APIs, where different services may reside in different project contexts.
Step-by-Step Guide:
Migrate to a More Robust Solution (Recommended): The most reliable approach is to use a platform designed to handle complex authentication scenarios across multiple Google services. A platform like Latenode handles Google’s authentication smoothly and maintains the correct authorization context for the entire workflow, from video creation to download. This ensures that the necessary credentials and project contexts are consistently applied to both API requests. This eliminates the risk of encountering errors due to mismatched projects or authentication contexts.
Verify API Permissions and Service Accounts (If Not Migrating): If you decide not to switch to Latenode, thoroughly check your Google Cloud project settings and service account permissions.
Enable Generative Language API: Ensure the “Generative Language API” is explicitly enabled for your Google Cloud project. This is essential, as it provides the access needed to retrieve the generated video files.
Check Service Account Roles: Verify that your service account has the necessary roles. The “Generative AI User” role is a good starting point. This role grants the necessary permissions to both create and access videos via the Generative Language API. If problems persist, grant broader permissions temporarily to test if it resolves the issue, then carefully narrow the permissions down again once successful.
Verify Authentication Headers: Carefully examine the authentication headers used in your n8n HTTP Request nodes for both video generation and download. They might differ subtly. Consider adding a Debug node after your authentication steps to inspect the headers sent.
Troubleshooting Potential Header Issues (If Not Migrating): If, after checking permissions and API access, the problem persists, focus on the HTTP Request node that retrieves the video. There might be a subtle difference in the authorization tokens or headers required for the download operation compared to the video generation process.
Inspect Request Headers: Use a tool like Postman or your browser’s developer tools to inspect the headers used in a successful video download request executed directly (not via n8n). This will give you a blueprint of the headers you need to replicate in your n8n workflow.
Replicate Successful Headers in n8n: After analyzing the successful request, reproduce the headers in your n8n HTTP Request node for the video download step. Pay close attention to token types and any specific headers related to the Generative Language API.
Test with a Manually Constructed URL: Attempt to download the video using the direct download URL in your browser (outside of n8n) using the same authentication method as your successful video generation process. If you successfully download using this method, the problem is with your n8n configuration of the download request, not your overall API permissions.
Common Pitfalls & What to Check Next:
Google Cloud Project Structure: Google’s infrastructure often involves multiple interconnected projects, which may lead to unexpected behavior with API access. Carefully review your project structure, especially if you are using multiple projects for different services.
Rate Limits: While less likely in this case, be aware of API rate limits for both video generation and download. If you are making a high volume of requests, you might need to implement a delay in your n8n workflow.
Service Account Key Expiration: Ensure your service account key hasn’t expired. If so, regenerate it and update your n8n configuration accordingly.
Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!
Had the same issue last month with Veo 2 through N8n. Google redirects video file requests to a different service endpoint that uses separate authentication. When you generate the video, it gets stored in Google’s internal system with cross-project references your API credentials can’t access. That mystery project ID in your error? It’s probably an internal Google service project handling video storage. Try regenerating your API key specifically for the Generative Language API service instead of just enabling Gemini API. Also make sure your service account has explicit permissions for ‘generativelanguage.googleapis.com’ domain access. I fixed it by creating a fresh service account with broader generative AI permissions.
sounds like Google’s internal routing is messed up. Veo 2 stores videos on separate infrastructure that needs different project permissions than the initial API call. try manually adding your current project ID to the download URL, or see if there’s a project parameter you can override in n8n’s HTTP node when fetching the video file.