{"record":{"id":"daef3e2b2d3517d9","repo":"BerriAI/litellm","slug":"vertex-project-is-required-for-vertex-ai-video-gen","errorCode":null,"errorMessage":"vertex_project is required for Vertex AI video generation. Set it via environment variable VERTEXAI_PROJECT or pass as parameter.","messagePattern":"vertex_project is required for Vertex AI video generation\\. Set it via environment variable VERTEXAI_PROJECT or pass as parameter\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/videos/transformation.py","lineNumber":267,"sourceCode":"        return headers\n\n    def get_complete_url(\n        self,\n        model: str,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for Veo video generation.\n\n        Returns URL for :predictLongRunning endpoint:\n        https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/publishers/google/models/MODEL:predictLongRunning\n        \"\"\"\n        vertex_project: Final = VertexBase.safe_get_vertex_ai_project(litellm_params)\n        vertex_location = VertexBase.safe_get_vertex_ai_location(litellm_params)\n\n        if not vertex_project:\n            raise ValueError(\n                \"vertex_project is required for Vertex AI video generation. \"\n                \"Set it via environment variable VERTEXAI_PROJECT or pass as parameter.\"\n            )\n\n        # Default to us-central1 if no location specified\n        vertex_location = vertex_location or \"us-central1\"\n\n        # Extract model name (remove vertex_ai/ prefix if present)\n        model_name: Final = model.replace(\"vertex_ai/\", \"\")\n\n        # Construct the URL\n        if api_base:\n            base_url = api_base.rstrip(\"/\")\n        else:\n            base_url = get_vertex_base_url(vertex_location)\n\n        url: Final = (\n            f\"{base_url}/v1/projects/{vertex_project}/locations/{vertex_location}/publishers/google/models/{model_name}\"","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/videos/transformation.py#L249-L285","documentation":"Raised while building the :predictLongRunning URL for Veo video generation when no Google Cloud project can be resolved. The URL template is `https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/.../models/MODEL:predictLongRunning`, so the project is structurally required; unlike location (which defaults to us-central1) there is no default. Resolution order is litellm_params vertex_project/vertex_ai_project, then litellm.vertex_project, then the VERTEXAI_PROJECT env var — all empty triggers the error.","triggerScenarios":"Calling litellm.video_generation(model=\"vertex_ai/veo-2.0-generate-001\", prompt=...) (or aretrieve_video_content) without vertex_project in the call, without litellm.vertex_project, and without VERTEXAI_PROJECT exported; location alone being set is not enough.","commonSituations":"Developers coming from Gemini API (AI Studio key) video calls where no project concept exists; scripts run outside the shell where VERTEXAI_PROJECT was exported; notebooks where the env cell was skipped after restart.","solutions":["Pass the project in the call: litellm.video_generation(model=\"vertex_ai/veo-2.0-generate-001\", prompt=p, vertex_project=\"my-project\").","Or export VERTEXAI_PROJECT=my-project (optionally VERTEXAI_LOCATION too) before starting the process.","Or set litellm.vertex_project = \"my-project\" at startup.","Check for typos: the env var is VERTEXAI_PROJECT, not GOOGLE_PROJECT or GCP_PROJECT."],"exampleFix":"# before\nvideo = litellm.video_generation(\n    model=\"vertex_ai/veo-2.0-generate-001\",\n    prompt=\"A cat surfing\",\n)\n\n# after\nvideo = litellm.video_generation(\n    model=\"vertex_ai/veo-2.0-generate-001\",\n    prompt=\"A cat surfing\",\n    vertex_project=\"my-gcp-project\",\n    vertex_location=\"us-central1\",\n)","handlingStrategy":"validation","validationCode":"import os\n\ndef veo_project() -> str:\n    p = os.getenv(\"VERTEXAI_PROJECT\")\n    if not p:\n        raise RuntimeError(\"VERTEXAI_PROJECT must be set for Vertex video generation\")\n    return p","typeGuard":null,"tryCatchPattern":"try:\n    v = litellm.video_generation(model=\"vertex_ai/veo-2.0-generate-001\", prompt=p, vertex_project=P)\nexcept ValueError as e:\n    if \"vertex_project is required\" in str(e):\n        raise ConfigError(\"Set VERTEXAI_PROJECT or pass vertex_project for Veo calls\") from e\n    raise","preventionTips":["Build one vertex_config helper (project+location+credentials) and spread it into every Veo call.","Assert project is present in your app's config validation at startup.","Remember Veo also needs the location to be a supported region — set vertex_location too."],"tags":["vertex-ai","veo","video-generation","project-id","configuration"],"backgroundTag":"gcp-project-id-missing","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}