{"record":{"id":"e0a214702674600e","repo":"BerriAI/litellm","slug":"fireworks-api-key-is-not-set-please-set-firework","errorCode":null,"errorMessage":"FIREWORKS_API_KEY is not set. Please set 'FIREWORKS_API_KEY' or 'FIREWORKS_AI_API_KEY' in your environment","messagePattern":"FIREWORKS_API_KEY is not set\\. Please set 'FIREWORKS_API_KEY' or 'FIREWORKS_AI_API_KEY' in your environment","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/fireworks_ai/rerank/transformation.py","lineNumber":108,"sourceCode":"            # Silently ignore max_chunks_per_doc as Fireworks AI doesn't support it\n            pass\n\n        if max_tokens_per_doc is not None:\n            # Silently ignore max_tokens_per_doc as Fireworks AI doesn't support it\n            pass\n\n        return params\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        api_key: str | None = None,\n        optional_params: dict | None = None,\n    ) -> dict:\n        api_key = self._get_api_key(api_key)\n        if api_key is None:\n            raise ValueError(\n                \"FIREWORKS_API_KEY is not set. Please set 'FIREWORKS_API_KEY' or 'FIREWORKS_AI_API_KEY' in your environment\"\n            )\n\n        default_headers: Final = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application/json\",\n        }\n\n        # If 'Authorization' is provided in headers, it overrides the default.\n        if \"Authorization\" in headers:\n            default_headers[\"Authorization\"] = headers[\"Authorization\"]\n\n        # Merge other headers, overriding any default ones except Authorization\n        return {**default_headers, **headers}\n\n    def transform_rerank_request(\n        self,\n        model: str,","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/fireworks_ai/rerank/transformation.py#L90-L126","documentation":"Error \"FIREWORKS_API_KEY is not set. Please set 'FIREWORKS_API_KEY' or 'FIREWORKS_AI_API_KEY' in your environment\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/fireworks_ai/rerank/transformation.py:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the FIREWORKS_API_KEY environment variable before making the call, e.g. export FIREWORKS_API_KEY=<your-key>.","Alternatively pass the credential directly via the api_key parameter in the litellm call.","FIREWORKS_AI_API_KEY is also accepted by some code paths."],"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"}