{"record":{"id":"b495782c402f42bf","repo":"BerriAI/litellm","slug":"invalid-vertex-project-format-project-id-r","errorCode":null,"errorMessage":"Invalid vertex_project format: {project_id!r}","messagePattern":"Invalid vertex_project format: (.+?)","errorType":"http","errorClass":"VertexAIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/vertex_ai/audio_transcription/transformation.py","lineNumber":124,"sourceCode":"        location: Final = self._validate_location(self.safe_get_vertex_ai_location(litellm_params))\n        project_id: Final = self._validate_project_id(\n            self.safe_get_vertex_ai_project(litellm_params) or self._resolve_project_id_from_credentials(litellm_params)\n        )\n        host: Final = \"speech.googleapis.com\" if location == \"global\" else f\"{location}-speech.googleapis.com\"\n        base_url: Final = (api_base or f\"https://{host}\").rstrip(\"/\")\n        return f\"{base_url}/v2/projects/{project_id}/locations/{location}/recognizers/_:recognize\"\n\n    @staticmethod\n    def _validate_location(location: str | None) -> str:\n        try:\n            return validate_vertex_location(location or DEFAULT_SPEECH_TO_TEXT_LOCATION)\n        except ValueError as e:\n            raise VertexAIError(status_code=400, message=str(e)) from e\n\n    @staticmethod\n    def _validate_project_id(project_id: str) -> str:\n        if not project_id or \"..\" in project_id or any(c in project_id for c in _URL_UNSAFE_PROJECT_CHARS):\n            raise VertexAIError(status_code=400, message=f\"Invalid vertex_project format: {project_id!r}\")\n        return project_id\n\n    def _resolve_project_id_from_credentials(self, litellm_params: dict) -> str:\n        _, project_id = self._ensure_access_token(\n            credentials=self.safe_get_vertex_ai_credentials(litellm_params),\n            project_id=None,\n            custom_llm_provider=\"vertex_ai\",\n        )\n        return project_id\n\n    def transform_audio_transcription_request(\n        self,\n        model: str,\n        audio_file: FileTypes,\n        optional_params: dict,\n        litellm_params: dict,\n    ) -> AudioTranscriptionRequestData:\n        processed_audio: Final = process_audio_file(audio_file)","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/audio_transcription/transformation.py#L106-L142","documentation":"Speech-to-Text _validate_project_id guard: the resolved project_id is not a valid GCP project identifier (e.g. contains illegal characters or wrong shape), so it is rejected before being placed in the v2 projects/.../recognizers URL.","triggerScenarios":"Triggered when the vertex_project value for audio transcription has an invalid format.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid GCP project id for vertex_project.","Check for typos or invalid characters in the project id."],"exampleFix":"vertex_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-14T05:17:10.506Z"}