{"record":{"id":"2f7631cebf8902a5","repo":"BerriAI/litellm","slug":"gdc-only-accepts-a-gdch-service-account-credential","errorCode":null,"errorMessage":"GDC only accepts a GDCH service account credential as a JSON api_key (expected \"type\": \"gdch_service_account\"). Other Google credential types are rejected so their token or external-account endpoints cannot drive server-side requests.","messagePattern":"GDC only accepts a GDCH service account credential as a JSON api_key \\(expected \"type\": \"gdch_service_account\"\\)\\. Other Google credential types are rejected so their token or external-account endpoints cannot drive server-side requests\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/gdc/chat/transformation.py","lineNumber":166,"sourceCode":"\n            gdch_creds: Final = self._gdch_creds_cache[cache_key]\n\n            if not getattr(gdch_creds, \"valid\", False) or not getattr(gdch_creds, \"token\", None):\n                self._fetch_auth(gdch_creds, ssl_verify)\n\n            token: Final = gdch_creds.token\n\n        return token\n\n    def _load_creds_from_key(self, api_key: str) -> tuple[Any, bool]:\n        import google.auth\n\n        try:\n            json_obj: Final = json.loads(api_key)\n        except json.JSONDecodeError:\n            return None, False\n        if not isinstance(json_obj, dict) or json_obj.get(\"type\") != self._GDCH_CREDENTIAL_TYPE:\n            raise ValueError(\n                \"GDC only accepts a GDCH service account credential as a JSON api_key \"\n                '(expected \"type\": \"gdch_service_account\"). Other Google credential types are '\n                \"rejected so their token or external-account endpoints cannot drive server-side requests.\"\n            )\n        creds, _ = google.auth.load_credentials_from_dict(json_obj)\n        return creds, True\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[Any],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,\n    ) -> dict:\n        import google.auth.exceptions","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/gdc/chat/transformation.py#L148-L184","documentation":"Error \"GDC only accepts a GDCH service account credential as a JSON api_key (expected \"type\": \"gdch_service_account\"). Other Google credential types are rejected so their token or external-account endpoints cannot drive server-side requests.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/gdc/chat/transformation.py:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the GDCH service account JSON (with \"type\": \"gdch_service_account\") as the api_key.","Do not use other Google credential types; they are rejected to prevent SSRF via token endpoints."],"exampleFix":null,"handlingStrategy":null,"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-23T08:17:48.524Z"}