BerriAI/litellm · error · ValueError

FIREWORKS_API_KEY is not set

Error message

FIREWORKS_API_KEY is not set

What it means

Error "FIREWORKS_API_KEY is not set" thrown in BerriAI/litellm.

Solutions

  1. Set the FIREWORKS_API_KEY environment variable before making the call, e.g. export FIREWORKS_API_KEY=<your-key>.
  2. Alternatively pass the credential directly via the api_key parameter in the litellm call.
  3. FIREWORKS_AI_API_KEY is also accepted by some code paths.

When it happens

Trigger: Thrown at litellm/llms/fireworks_ai/chat/transformation.py:198 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/153ce510a40ce3f1. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/fireworks_ai/chat/transformation.py:198

                setattr(self.__class__, key, value)

    @classmethod
    def get_config(cls):
        return super().get_config()

    def validate_environment(
        self,
        headers: dict,
        model: str,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        api_key: str | None = None,
        api_base: str | None = None,
    ) -> dict:
        api_key = self._get_api_key(api_key)
        if api_key is None:
            raise ValueError("FIREWORKS_API_KEY is not set")

        validated_headers: Final = OpenAIGPTConfig.validate_environment(
            self,
            headers=headers,
            model=model,
            messages=messages,
            optional_params=optional_params,
            litellm_params=litellm_params,
            api_key=api_key,
            api_base=api_base,
        )
        return self._add_session_affinity_header(validated_headers, litellm_params)

    def get_supported_openai_params(self, model: str):
        # Base parameters supported by all models
        supported_params: Final = [
            "stream",
            "max_completion_tokens",

View on GitHub (pinned to 77b7c6c40c)