{"record":{"id":"a3104cce8c37df03","repo":"BerriAI/litellm","slug":"api-key-must-be-provided-for-vantage-destination","errorCode":null,"errorMessage":"api_key must be provided for Vantage destination (set VANTAGE_API_KEY env var or pass in destination_config)","messagePattern":"api_key must be provided for Vantage destination \\(set VANTAGE_API_KEY env var or pass in destination_config\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/vantage_destination.py","lineNumber":103,"sourceCode":"        writer.writerow([row[i] for i in keep_indices])\n\n    return output.getvalue().encode(\"utf-8\")\n\n\nclass FocusVantageDestination(FocusDestination):\n    \"\"\"Upload FOCUS CSV exports to the Vantage cost-import API.\"\"\"\n\n    def __init__(\n        self,\n        *,\n        prefix: str,\n        config: dict[str, Any] | None = None,\n    ) -> None:\n        config = config or {}\n        api_key: Final = config.get(\"api_key\")\n        integration_token: Final = config.get(\"integration_token\")\n        if not api_key:\n            raise ValueError(\n                \"api_key must be provided for Vantage destination \"\n                \"(set VANTAGE_API_KEY env var or pass in destination_config)\"\n            )\n        if not integration_token:\n            raise ValueError(\n                \"integration_token must be provided for Vantage destination \"\n                \"(set VANTAGE_INTEGRATION_TOKEN env var or pass in destination_config)\"\n            )\n        self.api_key = api_key\n        self.integration_token = integration_token\n        self.base_url = config.get(\"base_url\", \"https://api.vantage.sh\")\n        self.prefix = prefix\n\n    async def deliver(\n        self,\n        *,\n        content: bytes,\n        time_window: FocusTimeWindow,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/focus/destinations/vantage_destination.py#L85-L121","documentation":"FocusVantageDestination.__init__ raises ValueError when no api_key is present in the destination config. The Vantage cost-import API requires an API key for every request; the error message names the two supported sources — the VANTAGE_API_KEY env var or destination_config['api_key'].","triggerScenarios":"Constructing the Vantage destination with config lacking 'api_key' while VANTAGE_API_KEY is not set in the environment (the env fallback happens upstream when the config is assembled).","commonSituations":"Forgetting to export VANTAGE_API_KEY in the proxy pod/container; typos like VANTAGE_KEY; rotating keys and leaving the old env unset; multi-env deployments where only one environment has the var.","solutions":["Set the env var: export VANTAGE_API_KEY=... (or the equivalent in your deployment secret).","Or pass it explicitly: config={'api_key': '...', 'integration_token': '...'}.","Verify with a print of os.getenv('VANTAGE_API_KEY') in the same process that builds the destination."],"exampleFix":"# before\nFocusVantageDestination(prefix=\"focus\", config={\"integration_token\": \"tok\"})\n\n# after\nFocusVantageDestination(\n    prefix=\"focus\",\n    config={\"api_key\": \"vt_...\", \"integration_token\": \"vti_...\"},\n)","handlingStrategy":"validation","validationCode":"api_key = dest_config.get(\"api_key\") or os.getenv(\"VANTAGE_API_KEY\")\nif not api_key:\n    raise ValueError(\"Set VANTAGE_API_KEY or destination_config['api_key'] before creating the Vantage destination\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check required env vars (VANTAGE_API_KEY, VANTAGE_INTEGRATION_TOKEN) in a startup preflight.","Store Vantage credentials in a secret manager; fail deployment when missing rather than at first export.","Unit-test destination construction with a fixture config containing both keys."],"tags":["config","vantage","env-vars","focus-export","auth"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}