{"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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/fireworks_ai/chat/transformation.py","lineNumber":766,"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":748,"sourceCodeEnd":784,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/fireworks_ai/chat/transformation.py#L748-L784","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:766 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set FIREWORKS_API_BASE and FIREWORKS_API_KEY environment variables to query the /models endpoint."],"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"}