{"record":{"id":"cb1b314ca4ab959b","repo":"BerriAI/litellm","slug":"vantage-api-key-must-be-provided-for-vantage-expor","errorCode":null,"errorMessage":"VANTAGE_API_KEY must be provided for Vantage exports","messagePattern":"VANTAGE_API_KEY must be provided for Vantage exports","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/factory.py","lineNumber":63,"sourceCode":"            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_S3_BUCKET_NAME\"),\n                \"region_name\": overrides.get(\"region_name\") or os.getenv(\"FOCUS_S3_REGION_NAME\"),\n                \"endpoint_url\": overrides.get(\"endpoint_url\") or os.getenv(\"FOCUS_S3_ENDPOINT_URL\"),\n                \"aws_access_key_id\": overrides.get(\"aws_access_key_id\") or os.getenv(\"FOCUS_S3_ACCESS_KEY\"),\n                \"aws_secret_access_key\": overrides.get(\"aws_secret_access_key\") or os.getenv(\"FOCUS_S3_SECRET_KEY\"),\n                \"aws_session_token\": overrides.get(\"aws_session_token\") or os.getenv(\"FOCUS_S3_SESSION_TOKEN\"),\n            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_S3_BUCKET_NAME must be provided for S3 exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"vantage\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"VANTAGE_API_KEY\"),\n                \"integration_token\": overrides.get(\"integration_token\") or os.getenv(\"VANTAGE_INTEGRATION_TOKEN\"),\n                \"base_url\": overrides.get(\"base_url\") or os.getenv(\"VANTAGE_BASE_URL\", \"https://api.vantage.sh\"),\n            }\n            if not resolved.get(\"api_key\"):\n                raise ValueError(\"VANTAGE_API_KEY must be provided for Vantage exports\")\n            if not resolved.get(\"integration_token\"):\n                raise ValueError(\"VANTAGE_INTEGRATION_TOKEN must be provided for Vantage exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"gcs\":\n            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_GCS_BUCKET_NAME\"),\n                \"service_account_json\": overrides.get(\"service_account_json\")\n                or os.getenv(\"FOCUS_GCS_PATH_SERVICE_ACCOUNT\"),\n            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_GCS_BUCKET_NAME must be provided for GCS exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"mavvrik\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"MAVVRIK_API_KEY\"),\n                \"api_endpoint\": overrides.get(\"api_endpoint\") or os.getenv(\"MAVVRIK_API_ENDPOINT\"),\n                \"connection_id\": overrides.get(\"connection_id\") or os.getenv(\"MAVVRIK_CONNECTION_ID\"),\n            }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/focus/destinations/factory.py#L45-L81","documentation":"For provider=\"vantage\", the factory resolves api_key from overrides or the VANTAGE_API_KEY env var. The Vantage API key is mandatory for authentication against api.vantage.sh, so a missing key raises ValueError before any destination object is constructed.","triggerScenarios":"Building a Focus export destination with provider=\"vantage\" while overrides has no api_key and VANTAGE_API_KEY is unset/empty in the environment.","commonSituations":"The Vantage API key secret was not injected into the pod/container; the key was stored under a differently named variable (e.g. VANTAGE_KEY); CI runs without the vantage credentials; empty-string value from a templating system ({{ secrets.X | default('') }}) which fails the falsy check.","solutions":["Set the env var: export VANTAGE_API_KEY=<your-key> from the Vantage console.","Or pass api_key directly in the destination config overrides.","If both VANTAGE_API_KEY and VANTAGE_INTEGRATION_TOKEN are needed, set both at once to avoid hitting the next validation error.","Verify the value is non-empty (not just present) — empty strings are rejected."],"exampleFix":"# before\nconfig = focus_destination_config(provider=\"vantage\", overrides={\"integration_token\": tok})\n\n# after\nconfig = focus_destination_config(\n    provider=\"vantage\",\n    overrides={\"api_key\": os.environ[\"VANTAGE_API_KEY\"], \"integration_token\": tok},\n)","handlingStrategy":"validation","validationCode":"import os\n\nif not (overrides.get(\"api_key\") or os.getenv(\"VANTAGE_API_KEY\")):\n    raise SystemExit(\"VANTAGE_API_KEY missing: set it before enabling the vantage Focus export\")","typeGuard":null,"tryCatchPattern":"try:\n    cfg = focus_destination_config(provider=\"vantage\", overrides=overrides)\nexcept ValueError as e:\n    if \"VANTAGE_API_KEY\" in str(e):\n        fetch_and_store_vantage_credentials()\n    raise","preventionTips":["Store VANTAGE_API_KEY and VANTAGE_INTEGRATION_TOKEN in the same secret so they rotate together.","Add a config lint step that greps deployment env for required vars per provider."],"tags":["focus","vantage","configuration","env-var","validation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}