{"record":{"id":"e5df121bc8a0ad63","repo":"BerriAI/litellm","slug":"fireworks-account-id-is-not-set-please-set-the-en","errorCode":null,"errorMessage":"FIREWORKS_ACCOUNT_ID is not set. Please set the environment variable, to query Fireworks AI's `/models` endpoint.","messagePattern":"FIREWORKS_ACCOUNT_ID 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":772,"sourceCode":"        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(\n                f\"Failed to fetch models from Fireworks AI. Status code: {response.status_code}, Response: {response.json()}\"\n            )\n\n        models: Final = response.json()[\"models\"]\n\n        return [\"fireworks_ai/\" + model[\"name\"] for model in models]","sourceCodeStart":754,"sourceCodeEnd":790,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/fireworks_ai/chat/transformation.py#L754-L790","documentation":"Error \"FIREWORKS_ACCOUNT_ID 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:772 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the FIREWORKS_ACCOUNT_ID environment variable to your Fireworks account id."],"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"}