BerriAI/litellm · error · ValueError

Google API key is required

Error message

Google API key is required

What it means

Error "Google API key is required" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/gemini/interactions/transformation.py:280

        logging_obj: LiteLLMLoggingObj,
    ) -> InteractionsAPIStreamingResponse:
        """Parse streaming chunk."""
        verbose_logger.debug("Google AI Interactions streaming chunk: %s", parsed_chunk)
        return InteractionsAPIStreamingResponse(**parsed_chunk)

    # GET / DELETE / CANCEL - just build URLs, responses match spec directly

    def transform_get_interaction_request(
        self,
        interaction_id: str,
        api_base: str,
        litellm_params: GenericLiteLLMParams,
        headers: dict,
    ) -> tuple[str, dict]:
        """GET /{api_version}/interactions/{interaction_id}"""
        resolved_api_base: Final = GeminiModelInfo.get_api_base(api_base)
        if not GeminiModelInfo.get_api_key(litellm_params.api_key):
            raise ValueError("Google API key is required")
        encoded_interaction_id: Final = encode_url_path_segment(interaction_id, field_name="interaction_id")
        return (
            f"{resolved_api_base}/{self.api_version}/interactions/{encoded_interaction_id}",
            {},
        )

    def transform_get_interaction_response(
        self,
        raw_response: httpx.Response,
        logging_obj: LiteLLMLoggingObj,
    ) -> InteractionsAPIResponse:
        try:
            raw_json: Final = raw_response.json()
        except Exception:
            raise GeminiError(
                message=raw_response.text,
                status_code=raw_response.status_code,
                headers=dict(raw_response.headers),

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set GOOGLE_API_KEY or GEMINI_API_KEY, or pass api_key.

When it happens

Trigger: Thrown at litellm/llms/gemini/interactions/transformation.py:280 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/b2c4e7ea597919b0. Report an issue: GitHub.