{"record":{"id":"696f7613c4a4454a","repo":"BerriAI/litellm","slug":"fireworks-api-base-or-fireworks-api-key-is-not-set","errorCode":null,"errorMessage":"FIREWORKS_API_BASE or FIREWORKS_API_KEY is not set. Please set the environment variable, to query Fireworks AI's `/models` endpoint.","messagePattern":"FIREWORKS_API_BASE or FIREWORKS_API_KEY is not set\\. Please set the environment variable, to query Fireworks AI's `/models` endpoint\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/fireworks_ai/chat/transformation.py","lineNumber":764,"sourceCode":"            json_mode=json_mode,\n        )\n\n    def _get_openai_compatible_provider_info(\n        self, api_base: str | None, api_key: str | None\n    ) -> tuple[str | None, str | None]:\n        api_base = api_base or get_secret_str(\"FIREWORKS_API_BASE\") or \"https://api.fireworks.ai/inference/v1\"\n        dynamic_api_key: Final = api_key or (\n            get_secret_str(\"FIREWORKS_API_KEY\")\n            or get_secret_str(\"FIREWORKS_AI_API_KEY\")\n            or get_secret_str(\"FIREWORKSAI_API_KEY\")\n            or get_secret_str(\"FIREWORKS_AI_TOKEN\")\n        )\n        return api_base, dynamic_api_key\n\n    def get_models(self, api_key: str | None = None, api_base: str | None = None):\n        api_base, api_key = self._get_openai_compatible_provider_info(api_base=api_base, api_key=api_key)\n        if api_base is None or api_key is None:\n            raise ValueError(\n                \"FIREWORKS_API_BASE or FIREWORKS_API_KEY is not set. Please set the environment variable, to query Fireworks AI's `/models` endpoint.\"\n            )\n\n        account_id: Final = get_secret_str(\"FIREWORKS_ACCOUNT_ID\")\n        if account_id is None:\n            raise ValueError(\n                \"FIREWORKS_ACCOUNT_ID is not set. Please set the environment variable, to query Fireworks AI's `/models` endpoint.\"\n            )\n\n        base = api_base.rstrip(\"/\")\n        base = base.removesuffix(\"/v1\")\n        response: Final = litellm.module_level_client.get(\n            url=f\"{base}/v1/accounts/{account_id}/models\",\n            headers={\"Authorization\": f\"Bearer {api_key}\"},\n        )\n\n        if response.status_code != 200:\n            raise ValueError(","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/fireworks_ai/chat/transformation.py#L746-L782","documentation":"Error \"FIREWORKS_API_BASE or FIREWORKS_API_KEY is not set. Please set the environment variable, to query Fireworks AI's `/models` endpoint.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/fireworks_ai/chat/transformation.py:764 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set FIREWORKS_API_BASE and FIREWORKS_API_KEY to query the /models endpoint."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}