{"record":{"id":"eb46462ab399d987","repo":"BerriAI/litellm","slug":"vertex-project-is-required-for-vertex-agent-engine","errorCode":null,"errorMessage":"vertex_project is required for Vertex Agent Engine. Set via litellm_params['vertex_project'] or VERTEXAI_PROJECT env var.","messagePattern":"vertex_project is required for Vertex Agent Engine\\. Set via litellm_params\\['vertex_project'\\] or VERTEXAI_PROJECT env var\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/agent_engine/transformation.py","lineNumber":127,"sourceCode":"        stream: bool | None = None,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for the request.\n\n        For Vertex Agent Engine:\n        - Non-streaming: :query endpoint (for session management)\n        - Streaming: :streamQuery endpoint (for actual queries)\n        \"\"\"\n        resource_path, engine_id = self._parse_model_string(model)\n\n        # Get project and location from litellm_params or environment\n        vertex_project: Final = self.safe_get_vertex_ai_project(litellm_params)\n        vertex_location: Final = self.safe_get_vertex_ai_location(litellm_params) or \"us-central1\"\n\n        # Build the full resource path if only engine_id was provided\n        if not resource_path.startswith(\"projects/\"):\n            if not vertex_project:\n                raise ValueError(\n                    \"vertex_project is required for Vertex Agent Engine. \"\n                    \"Set via litellm_params['vertex_project'] or VERTEXAI_PROJECT env var.\"\n                )\n            resource_path = f\"projects/{vertex_project}/locations/{vertex_location}/reasoningEngines/{engine_id}\"\n\n        base_url: Final = get_vertex_base_url(vertex_location)\n\n        # Always use :streamQuery endpoint for actual queries\n        # The :query endpoint only supports session management methods\n        # (create_session, get_session, list_sessions, delete_session, etc.)\n        endpoint: Final = f\"{base_url}/v1beta1/{resource_path}:streamQuery\"\n\n        verbose_logger.debug(\"Vertex Agent Engine URL: %s\", endpoint)\n        return endpoint\n\n    def _get_auth_headers(\n        self,\n        optional_params: dict,","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/agent_engine/transformation.py#L109-L145","documentation":"Vertex Agent Engine URL builder guard: the GCP project could not be resolved from litellm_params['vertex_project'] or the VERTEXAI_PROJECT env var, so the required projects/... URL path cannot be constructed.","triggerScenarios":"Triggered when calling Vertex Agent Engine without vertex_project in litellm_params and VERTEXAI_PROJECT unset.","commonSituations":"See trigger scenarios.","solutions":["Set VERTEXAI_PROJECT environment variable.","Or pass vertex_project in litellm_params."],"exampleFix":"os.environ[\"VERTEXAI_PROJECT\"] = \"my-gcp-project\"","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}